Update controlnet.py

This commit is contained in:
lllyasviel
2024-01-31 10:02:45 -08:00
parent 8949396aae
commit 5c4102e93e

View File

@@ -490,7 +490,7 @@ class ControlNetForForgeOfficial(scripts.Script):
kwargs.update(dict(unit=unit, params=params))
# CN inpaint fix
if cond.ndim == 4 and cond.shape[1] == 4:
if isinstance(cond, torch.Tensor) and cond.ndim == 4 and cond.shape[1] == 4:
kwargs['cond_before_inpaint_fix'] = cond.clone()
cond = cond[:, :3] * (1.0 - cond[:, 3:]) - cond[:, 3:]