From e166f6a1f3cfefb8936ea57b29c9464360cddf08 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 23 Oct 2025 11:01:20 -0400 Subject: [PATCH] linting Signed-off-by: Vladimir Mandic --- TODO.md | 3 +-- installer.py | 2 +- modules/images_namegen.py | 4 ++-- modules/processing_callbacks.py | 12 ++++-------- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/TODO.md b/TODO.md index 56ece93cd..6471ccd81 100644 --- a/TODO.md +++ b/TODO.md @@ -4,9 +4,9 @@ Main ToDo list can be found at [GitHub projects](https://github.com/users/vladma ## Future Candidates +- [Kanvas](https://github.com/vladmandic/kanvas) - Transformers unified cache handler - Remote TE -- [Canvas](https://konvajs.org/) - Refactor: [Modular pipelines and guiders](https://github.com/huggingface/diffusers/issues/11915) - Refactor: Sampler options - Refactor: [GGUF](https://huggingface.co/docs/diffusers/main/en/quantization/gguf) @@ -34,7 +34,6 @@ Main ToDo list can be found at [GitHub projects](https://github.com/users/vladma ### New models - [Ovi](https://github.com/character-ai/Ovi) -- [Kandinsky 5](https://github.com/ai-forever/Kandinsky-5) - [Bytedance Lynx](https://github.com/bytedance/lynx) - [HunyuanImage](https://huggingface.co/tencent/HunyuanImage-2.1) - [Phantom HuMo](https://github.com/Phantom-video/Phantom) diff --git a/installer.py b/installer.py index 6a8948ff7..d668cb86d 100644 --- a/installer.py +++ b/installer.py @@ -388,7 +388,7 @@ def pip(arg: str, ignore: bool = False, quiet: bool = True, uv = True): arg = arg.replace('>=', '==') if opts.get('offline_mode', False): log.warning('Offline mode enabled') - return + return 'offline' package = arg.replace("install", "").replace("--upgrade", "").replace("--no-deps", "").replace("--force-reinstall", "").replace(" ", " ").strip() uv = uv and args.uv and not package.startswith('git+') pipCmd = "uv pip" if uv else "pip" diff --git a/modules/images_namegen.py b/modules/images_namegen.py index b89adbb7a..428dbc26e 100644 --- a/modules/images_namegen.py +++ b/modules/images_namegen.py @@ -170,8 +170,8 @@ class FilenameGenerator: # starting reference: invalid_chars = ( "#<>/\\\"'`" # ASCII quote and backtick - "’‚‛\u2018\u2019\u201B" # smart single quotes and variants - "\u02BB" # modifier letter turned comma (ʻ) + "’‚‛\u2018\u2019\u201B" # smart single quotes and variants # noqa: RUF001 + "\u02BB" # modifier letter turned comma "\u201C\u201D\u201F" # smart double quotes and variants "|?*^%$\u00A0\u2013\u2014\n\t\r" # pipes, wildcards, percent, currency, NBSP, dashes, control chars ) diff --git a/modules/processing_callbacks.py b/modules/processing_callbacks.py index e36bd0e75..d62d464dc 100644 --- a/modules/processing_callbacks.py +++ b/modules/processing_callbacks.py @@ -95,23 +95,19 @@ def diffusers_callback(pipe, step: int = 0, timestep: int = 0, kwargs: dict = {} kwargs = prompt_callback(step, kwargs) # monkey patch for diffusers callback issues if step == 0: - setattr(pipe, "_cfg_end_applied", False) + pipe._cfg_end_applied = False # pylint: disable=protected-access cfg_end = getattr(p, "cfg_end", 1.0) or 1.0 total_steps = getattr(pipe, "num_timesteps", 0) target_step = int(total_steps * cfg_end) if total_steps else 0 - if ( - cfg_end < 1.0 - and not getattr(pipe, "_cfg_end_applied", False) - and step >= target_step - ): - setattr(pipe, "_cfg_end_applied", True) + if (cfg_end < 1.0) and not getattr(pipe, "_cfg_end_applied", False) and (step >= target_step): + pipe._cfg_end_applied = True # pylint: disable=protected-access if "PAG" in shared.sd_model.__class__.__name__: pipe._guidance_scale = 1.001 if pipe._guidance_scale > 1 else pipe._guidance_scale # pylint: disable=protected-access pipe._pag_scale = 0.001 # pylint: disable=protected-access else: pipe._guidance_scale = 0.0 # pylint: disable=protected-access - for key in {"prompt_embeds", "negative_prompt_embeds", "add_text_embeds", "add_time_ids"}: + for key in ["prompt_embeds", "negative_prompt_embeds", "add_text_embeds", "add_time_ids"]: tensor = kwargs.get(key, None) if tensor is not None and hasattr(tensor, "chunk") and tensor.shape[0] % 2 == 0: kwargs[key] = tensor.chunk(2)[-1]