restore orig init image for each batch sequence

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-10-19 21:36:49 -04:00
parent 612564a200
commit 76632838bb
3 changed files with 11 additions and 7 deletions
+2
View File
@@ -5,6 +5,7 @@
- **Features**
- **offline mode**: enable in *settings -> hugginface*
enables fully offline mode where previously downloaded models are used as-is
*note*: must be enabled only after all packages have been installed and model has been run online at least once
- **Backend**
- switch to `torch==2.9` for *ipex, rocm and openvino*
- switch to `rocm==7.0` for nightlies
@@ -14,6 +15,7 @@
- **scheduler** add base and max shift parameters for flow-matching samplers
- **Fixes**
- startup error with `--profile` enabled if using `--skip`
- restore orig init image for each batch sequence
## Update for 2025-10-18
+2
View File
@@ -391,7 +391,9 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
if not hasattr(p, 'skip_init'):
p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
debug(f'Processing inner: args={vars(p)}')
p.iter_init_images = p.init_images # required so we use same starting non-processed images for each batch sequence
for n in range(p.n_iter):
p.init_images = p.iter_init_images
if p.n_iter > 1:
shared.log.debug(f'Processing: batch={n+1} total={p.n_iter} progress={(n+1)/p.n_iter:.2f}')
shared.state.batch_no = n + 1
+7 -7
View File
@@ -123,11 +123,11 @@ def task_specific_kwargs(p, model):
}
# model specific args
if 'QwenImageEdit' in model_cls and (p.init_images is None or len(p.init_images) == 0):
if ('QwenImageEdit' in model_cls) and (p.init_images is None or len(p.init_images) == 0):
task_args['image'] = [Image.new('RGB', (p.width, p.height), (0, 0, 0))] # monkey-patch so qwen-image-edit pipeline does not error-out on t2i
if 'QwenImageEditPlusPipeline' in model_cls and p.init_control is not None and len(p.init_control) > 0:
if ('QwenImageEditPlusPipeline' in model_cls) and (p.init_control is not None) and (len(p.init_control) > 0):
task_args['image'] += p.init_control
if 'LatentConsistencyModelPipeline' in model_cls and len(p.init_images) > 0:
if ('LatentConsistencyModelPipeline' in model_cls) and (len(p.init_images) > 0):
p.ops.append('lcm')
init_latents = [processing_vae.vae_encode(image, model=shared.sd_model, vae_type=p.vae_type).squeeze(dim=0) for image in p.init_images]
init_latent = torch.stack(init_latents, dim=0).to(shared.device)
@@ -138,6 +138,10 @@ def task_specific_kwargs(p, model):
'width': p.width,
'height': p.height,
}
if ('WanImageToVideoPipeline' in model_cls) and (p.init_images is not None) and (len(p.init_images) > 0):
task_args['image'] = p.init_images[0]
if ('WanVACEPipeline' in model_cls) and (p.init_images is not None) and (len(p.init_images) > 0):
task_args['reference_images'] = p.init_images
if 'BlipDiffusionPipeline' in model_cls:
if len(p.init_images) == 0:
shared.log.error('BLiP diffusion requires init image')
@@ -148,10 +152,6 @@ def task_specific_kwargs(p, model):
'target_subject_category': getattr(p, 'prompt', '').split()[-1],
'output_type': 'pil',
}
if ('WanImageToVideoPipeline' in model_cls) and (p.init_images is not None) and (len(p.init_images) > 0):
task_args['image'] = p.init_images[0]
if ('WanVACEPipeline' in model_cls) and (p.init_images is not None) and (len(p.init_images) > 0):
task_args['reference_images'] = p.init_images
if debug_enabled:
debug_log(f'Process task specific args: {task_args}')