mirror of
https://github.com/vladmandic/sdnext.git
synced 2026-10-11 22:49:59 +00:00
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:
@@ -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,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
|
||||
|
||||
Reference in New Issue
Block a user