Merge branch 'diffusion-auto-badges' into diffusion-more-families

This commit is contained in:
Daniel Han 2026-07-05 04:56:27 +00:00
commit d89ed5c6ff
5 changed files with 71 additions and 5 deletions

View file

@ -1837,7 +1837,14 @@ class DiffusionBackend:
pipe = getattr(diffusers, pipe_cls_name).from_pipe(
state.pipe, controlnet = cn_model, torch_dtype = None
)
self._cn_pipes[key] = pipe
with self._lock:
# Same race as the model cache above: an unload/superseding load may
# have cleared _cn_pipes while from_pipe ran; caching now would pin a
# pipeline built around the UNLOADED base and hand it to the next load.
if cancel.is_set() or self._state is not state:
del pipe
raise RuntimeError(DIFFUSION_CANCELLED_MSG)
self._cn_pipes[key] = pipe
return pipe
@staticmethod