mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(backend): fix controlnet zip len
Do not use `strict=True` when scaling controlnet conditioning. When using `guess_mode` (e.g. `more_control` or `more_prompt`), `down_block_res_samples` and `scales` are zipped. These two objects are of different lengths, so using zip's strict mode raises an error. In testing, `len(scales) === len(down_block_res_samples) + 1`. It appears this behaviour is intentional, as the final "extra" item in `scales` is used immediately afterwards.
This commit is contained in:
parent
355d4cf4e2
commit
04d8f2dfea
@ -748,7 +748,7 @@ class ControlNetModel(ModelMixin, ConfigMixin, FromOriginalControlnetMixin):
|
||||
|
||||
scales = scales * conditioning_scale
|
||||
down_block_res_samples = [
|
||||
sample * scale for sample, scale in zip(down_block_res_samples, scales, strict=True)
|
||||
sample * scale for sample, scale in zip(down_block_res_samples, scales, strict=False)
|
||||
]
|
||||
mid_block_res_sample = mid_block_res_sample * scales[-1] # last one
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user