ruff lint

This commit is contained in:
Vladimir Mandic
2026-02-19 11:13:44 +01:00
parent e5c494f999
commit d65a2d1ebc
30 changed files with 59 additions and 73 deletions
+6 -6
View File
@@ -1901,15 +1901,15 @@ class Script(scripts_manager.Script):
if not enabled:
return
if shared.sd_model_type not in ['sdxl', 'sd', 'f1']:
sdnext_log.error(f'Differential-diffusion: incorrect base model: {shared.sd_model.__class__.__name__}')
log.error(f'Differential-diffusion: incorrect base model: {shared.sd_model.__class__.__name__}')
return
if not hasattr(p, 'init_images') or len(p.init_images) == 0:
sdnext_log.error('Differential-diffusion: no input images')
log.error('Differential-diffusion: no input images')
return
image_init, image_map, image_mask = self.depthmap(p.init_images[0], image, model, strength, invert)
if image_map is None:
sdnext_log.error('Differential-diffusion: no image map')
log.error('Differential-diffusion: no image map')
return
orig_pipeline = shared.sd_model
@@ -1950,13 +1950,13 @@ class Script(scripts_manager.Script):
if shared.sd_model_type == 'sdxl':
p.task_args['original_image'] = image_init
if p.batch_size > 1:
sdnext_log.warning(f'Differential-diffusion: batch-size={p.batch_size} parallel processing not supported')
log.warning(f'Differential-diffusion: batch-size={p.batch_size} parallel processing not supported')
p.batch_size = 1
sdnext_log.debug(f'Differential-diffusion: pipeline={pipe.__class__.__name__} strength={strength} model={model} auto={image is None}')
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)
except Exception as e:
sdnext_log.error(f'Differential-diffusion: pipeline creation failed: {e}')
log.error(f'Differential-diffusion: pipeline creation failed: {e}')
errors.display(e, 'Differential-diffusion: pipeline creation failed')
shared.sd_model = orig_pipeline
+6 -6
View File
@@ -1631,13 +1631,13 @@ class Script(scripts_manager.Script):
if not enabled:
return
if shared.sd_model_type not in ['sdxl']:
sdnext_log.error(f'SoftFill: incorrect base model: {shared.sd_model.__class__.__name__}')
log.error(f'SoftFill: incorrect base model: {shared.sd_model.__class__.__name__}')
return
if not hasattr(p, 'init_images') or len(p.init_images) == 0:
sdnext_log.error('SoftFill: no input image')
log.error('SoftFill: no input image')
return
if not hasattr(p, 'mask') or p.mask is None:
sdnext_log.error('SoftFill: no input mask')
log.error('SoftFill: no input mask')
return
try:
@@ -1646,7 +1646,7 @@ class Script(scripts_manager.Script):
import noise as noise_module
pnoise2 = noise_module.pnoise2
except Exception as e:
sdnext_log.error(f'SoftFill: {e}')
log.error(f'SoftFill: {e}')
return
self.orig_pipeline = shared.sd_model
@@ -1655,7 +1655,7 @@ class Script(scripts_manager.Script):
if shared.sd_model.__class__.__name__ not in sd_models.pipe_switch_task_exclude:
sd_models.pipe_switch_task_exclude.append(shared.sd_model.__class__.__name__)
except Exception as e:
sdnext_log.error(f'SoftFill: {e}')
log.error(f'SoftFill: {e}')
shared.sd_model = self.orig_pipeline
self.orig_pipeline = None
return
@@ -1664,7 +1664,7 @@ class Script(scripts_manager.Script):
p.task_args['strength'] = strength
p.task_args['image'] = p.init_images[0]
p.task_args['mask'] = p.mask
sdnext_log.info(f'SoftFill: cls={shared.sd_model.__class__.__name__} {p.task_args}')
log.info(f'SoftFill: cls={shared.sd_model.__class__.__name__} {p.task_args}')
def after(self, p: processing.StableDiffusionProcessingImg2Img, *args, **kwargs): # pylint: disable=unused-argument
if self.orig_pipeline is not None: