fix ernie preview

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-05-02 08:06:57 +02:00
parent c855a5146a
commit 63190a50e7
4 changed files with 9 additions and 4 deletions
+3 -1
View File
@@ -4,7 +4,7 @@
- Tag multi-image pipes with `use_images_direct` and allow UI override
## Update for 2026-04-30
## Update for 2026-05-02
- **Features**
- **Multi-image** workflows!
@@ -27,6 +27,8 @@
- refactor `pip` installer, thanks @awsr
- **Fixes**
- save handle already decoded images
- ernie-image preview
- lora false deactivate
## Update for 2026-04-28
+1
View File
@@ -5,6 +5,7 @@ from modules.logger import log
# value is cost: -1=disabled, 0=unlimited, 1=default, >1 expensive
request_cost = {
"/file": 0,
"/internal/progress": 0,
"/run/predict": 0,
"/sdapi/v1/browser/thumb": 0,
"/sdapi/v1/network/thumb": 0,
+3 -1
View File
@@ -139,7 +139,9 @@ def diffusers_callback(pipe, step: int = 0, timestep: int = 0, kwargs: dict | No
width = getattr(p, 'width', 1024)
height = getattr(p, 'height', 1024)
latents = kwargs['latents']
if len(latents.shape) == 3: # packed format [B, seq_len, patch_channels]
if len(latents.shape) == 4:
latents = pipe._unpatchify_latents(latents) # [B, C*4, h/2, w/2] -> [B, C, h, w] # pylint: disable=protected-access
elif len(latents.shape) == 3: # packed format [B, seq_len, patch_channels]
b, seq_len, patch_ch = latents.shape
channels = patch_ch // 4 # 4 = 2x2 patch
h_patches = height // vae_scale // 2
+2 -2
View File
@@ -242,7 +242,7 @@ def process_base(p: processing.StableDiffusionProcessing):
def process_hires(p: processing.StableDiffusionProcessing, output):
# optional second pass
if (output is None) or (output.images is None):
if (output is None) or not hasattr(output, 'images') or (output.images is None):
return output
if p.enable_hr:
jobid = shared.state.begin('Hires')
@@ -368,7 +368,7 @@ def process_hires(p: processing.StableDiffusionProcessing, output):
def process_refine(p: processing.StableDiffusionProcessing, output):
# optional refiner pass or decode
if (output is None) or (output.images is None):
if (output is None) or not hasattr(output, 'images') or (output.images is None):
return output
if is_refiner_enabled(p):
if shared.opts.samples_save and not p.do_not_save_samples and shared.opts.save_images_before_refiner and hasattr(shared.sd_model, 'vae'):