mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
error handling on incompatible batch-sizes
This commit is contained in:
@@ -298,8 +298,10 @@ def process_diffusers(p: processing.StableDiffusionProcessing):
|
||||
clean['generator'] = generator_device
|
||||
clean['parser'] = parser
|
||||
for k, v in clean.items():
|
||||
if isinstance(v, torch.Tensor) or isinstance(v, np.ndarray) or (isinstance(v, list) and len(v) > 0 and (isinstance(v[0], torch.Tensor) or isinstance(v[0], np.ndarray))):
|
||||
if isinstance(v, torch.Tensor) or isinstance(v, np.ndarray):
|
||||
clean[k] = v.shape
|
||||
if isinstance(v, list) and len(v) > 0 and (isinstance(v[0], torch.Tensor) or isinstance(v[0], np.ndarray)):
|
||||
clean[k] = [x.shape for x in v]
|
||||
shared.log.debug(f'Diffuser pipeline: {model.__class__.__name__} task={sd_models.get_diffusers_task(model)} set={clean}')
|
||||
if p.hdr_clamp or p.hdr_maximize or p.hdr_brightness != 0 or p.hdr_color != 0 or p.hdr_sharpen != 0:
|
||||
txt = 'HDR:'
|
||||
|
||||
@@ -1970,6 +1970,9 @@ class Script(scripts.Script):
|
||||
p.task_args['map'] = image_map
|
||||
if shared.sd_model_type == 'sdxl':
|
||||
p.task_args['original_image'] = image_init
|
||||
if p.batch_size > 1:
|
||||
shared.log.warning(f'Differential-diffusion: batch-size={p.batch_size} parallel processing not supported')
|
||||
p.batch_size = 1
|
||||
shared.log.debug(f'Differential-diffusion: pipeline={pipe.__class__.__name__} strength={strength} model={model} auto={image is None}')
|
||||
shared.sd_model = pipe
|
||||
sd_models.move_model(pipe.vae, devices.device, force=True)
|
||||
|
||||
Reference in New Issue
Block a user