fix(callbacks): take only a pil image in step callback kwargs as a preview

sd and sdxl txt2img controlnet pipelines pass their control tensors as image; the callback took them as a preview and returned before the interrupt check.
This commit is contained in:
CalamitousFelicitousness
2026-10-06 08:12:30 +01:00
parent 5133cae542
commit f52006315f
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -39,6 +39,7 @@
- control: controlnet with *init image same as control* uses the unit's processed image
- control: multiple units on controlnet-union
- control: t2i-adapter, controlnet-xs and controllite model lists follow the loaded model type
- control: live preview and interrupt for sd and sdxl controlnet without an init image
## Update for 2026-10-01
+2 -1
View File
@@ -2,6 +2,7 @@ import os
import time
import torch
import numpy as np
from PIL import Image
from modules import shared, devices, processing_correction, timer, prompt_parser_diffusers
from modules.logger import log
from modules.attention import context as attention_context
@@ -83,7 +84,7 @@ def diffusers_callback(pipe, step: int = 0, timestep: int = 0, kwargs: dict | No
time.sleep(0.1)
image = kwargs.get('image', None)
if image is not None:
if isinstance(image, Image.Image): # decoded preview; controlnet pipelines pass control tensors as image
shared.state.current_image = image
shared.state.current_latent = None
shared.state.step() # increase step