update diffusers, release notes, lint fixes

This commit is contained in:
Vladimir Mandic
2024-05-27 08:59:57 -04:00
parent 87d644cd67
commit 0cedf950f2
17 changed files with 36 additions and 40 deletions
+8
View File
@@ -16,6 +16,7 @@ exclude = [
"modules/intel/openvino",
"modules/intel/ipex",
"modules/dml",
"modules/segmoe",
"modules/control/proc",
"modules/control/units",
"repositories",
@@ -53,11 +54,18 @@ select = [
]
ignore = [
"B006", # Do not use mutable data structures for argument defaults
"B008", # Do not perform function call in argument defaults
"C408", # Unnecessary `dict` call
"I001", # Import block is un-sorted or un-formatted
"E402", # Module level import not at top of file
"E501", # Line too long
"E721", # Do not compare types, use `isinstance()`
"E731", # Do not assign a `lambda` expression, use a `def`
"E741", # Ambiguous variable name
"F401", # Imported by unused
"RUF005", # Consider iterable unpacking
"RUF010", # Use explicit conversion flag
"RUF012", # Mutable class attributes
"RUF013", # PEP 484 prohibits implicit `Optional`
]
fixable = ["ALL"]
+1 -1
View File
@@ -1,6 +1,6 @@
# Change Log for SD.Next
## Update for 2024-05-24
## Update for 2024-05-27
- **Features**:
- **ModernUI** preview of the new [ModernUI](https://github.com/BinaryQuantumSoul/sdnext-modernui)
+1 -9
View File
@@ -2,17 +2,9 @@
Main ToDo list can be found at [GitHub projects](https://github.com/users/vladmandic/projects)
## Pending
Requires `diffusers-0.28.0.dev0`:
- PixArt-Σ
- IP adapter masking
- InstantStyle
- Sampler timesteps
## Dev Release Notes
New [SD.Next](https://github.com/vladmandic/automatic) release has been baking in `dev` for a longer than usual, but changes are massive - over 330 commits...
New [SD.Next](https://github.com/vladmandic/automatic) release has been baking in `dev` for a longer than usual, but changes are massive - about 350 commits for core and 300 for UI...
Starting with the new UI - yup, this version ships with a *preview* of the new [ModernUI](https://github.com/BinaryQuantumSoul/sdnext-modernui)
For details on how to enable and use it, see [Home](https://github.com/BinaryQuantumSoul/sdnext-modernui) and [WiKi](https://github.com/vladmandic/automatic/wiki/Themes)
+2 -2
View File
@@ -121,7 +121,7 @@ class NetworkModule:
return updown * self.calc_scale() * self.multiplier(), ex_bias
def calc_updown(self, target):
raise NotImplementedError()
raise NotImplementedError
def forward(self, x, y):
raise NotImplementedError()
raise NotImplementedError
+2 -2
View File
@@ -2,7 +2,7 @@ from modules import shared
force_diffusers = [
'aaebf6360f7d', # sd15-lcm
'aaebf6360f7d', # sd15-lcm
'3d18b05e4f56', # sdxl-lcm
'b71dcb732467', # sdxl-tcd
'813ea5fb1c67', # sdxl-turbo
@@ -24,7 +24,7 @@ def check_override(shorthash):
return False
if len(shorthash) < 4:
return False
force = any([x.startswith(shorthash) for x in force_diffusers])
force = any(x.startswith(shorthash) for x in force_diffusers)
if force:
shared.log.debug('LoRA override: force diffusers')
return force
@@ -1,6 +1,6 @@
import re
import networks
import lora # noqa:F401 # pylint: disable=unused-import
import lora # pylint: disable=unused-import
from network import NetworkOnDisk
from ui_extra_networks_lora import ExtraNetworksPageLora
from extra_networks_lora import ExtraNetworkLora
@@ -81,7 +81,7 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
possible_tags = info.get('tags', []) # tags from info json
if not isinstance(possible_tags, list):
possible_tags = [v for v in possible_tags.values()]
possible_tags = list(possible_tags.values())
for tag in possible_tags:
tag = tag.strip().lower()
if tag not in tags:
@@ -90,7 +90,7 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
bad_chars = [';', ':', '<', ">", "*", '?', '\'', '\"', '(', ')', '[', ']', '{', '}', '\\', '/']
clean_tags = {}
for k, v in tags.items():
tag = ''.join(i for i in k if not i in bad_chars).strip()
tag = ''.join(i for i in k if i not in bad_chars).strip()
clean_tags[tag] = v
clean_tags.pop('img', None)
+5 -5
View File
@@ -279,10 +279,10 @@ def parse_prompt_attention(text):
(abc) - increases attention to abc by a multiplier of 1.1
(abc:3.12) - increases attention to abc by a multiplier of 3.12
[abc] - decreases attention to abc by a multiplier of 1.1
\( - literal character '('
\[ - literal character '['
\) - literal character ')'
\] - literal character ']'
( - literal character '('
[ - literal character '['
) - literal character ')'
] - literal character ']'
\\ - literal character '\'
anything else - just text
>>> parse_prompt_attention('normal text')
@@ -291,7 +291,7 @@ def parse_prompt_attention(text):
[['an ', 1.0], ['important', 1.1], [' word', 1.0]]
>>> parse_prompt_attention('(unbalanced')
[['unbalanced', 1.1]]
>>> parse_prompt_attention('\(literal\]')
>>> parse_prompt_attention('(literal]')
[['(literal]', 1.0]]
>>> parse_prompt_attention('(unnecessary)(parens)')
[['unnecessaryparens', 1.1]]
+1 -5
View File
@@ -100,11 +100,7 @@ def create_ui():
with gr.TabItem('Batch', id='batch', elem_id="img2img_batch_tab") as tab_batch:
hidden = '<br>Disabled when launched with --hide-ui-dir-config.' if shared.cmd_opts.hide_ui_dir_config else ''
gr.HTML(
"<p style='padding-bottom: 1em;' class=\"text-gray-500\">Upload images or process images in a directory" +
"<br>Add inpaint batch mask directory to enable inpaint batch processing"
f"{hidden}</p>"
)
gr.HTML(f"<p style='padding-bottom: 1em;' class=\"text-gray-500\">Upload images or process images in a directory <br>Add inpaint batch mask directory to enable inpaint batch processing {hidden}</p>")
img2img_batch_files = gr.Files(label="Batch Process", interactive=True, elem_id="img2img_image_batch")
img2img_batch_input_dir = gr.Textbox(label="Inpaint batch input directory", **shared.hide_dirs, elem_id="img2img_batch_input_dir")
img2img_batch_output_dir = gr.Textbox(label="Inpaint batch output directory", **shared.hide_dirs, elem_id="img2img_batch_output_dir")
+1 -1
View File
@@ -752,7 +752,7 @@ def create_ui():
def civit_update_select(evt: gr.SelectData, in_data):
nonlocal selected_model, update_data
try:
selected_model = [m for m in update_data if m.fn == in_data[evt.index[0]][1]][0]
selected_model = next([m for m in update_data if m.fn == in_data[evt.index[0]][1]])
except Exception:
selected_model = None
if selected_model is None or selected_model.url is None or selected_model.status != 'Available':
+5 -2
View File
@@ -16,8 +16,11 @@
"url": "git+https://github.com/vladmandic/automatic.git"
},
"scripts": {
"start": "python launch.py",
"lint": "ruff check; eslint javascript/ extensions-builtin/sdnext-modernui/javascript/; pylint *.py modules/ extensions-builtin/"
"start": "python launch.py --debug --experimental",
"ruff": "ruff check",
"eslint": "eslint javascript/ extensions-builtin/sdnext-modernui/javascript/",
"pylint": "pylint *.py modules/ extensions-builtin/",
"lint": "npm run eslint; npm run ruff; npm run pylint"
},
"devDependencies": {
"esbuild": "^0.18.15"
+1 -1
View File
@@ -46,7 +46,7 @@ requests==2.31.0
tqdm==4.66.4
accelerate==0.30.1
opencv-contrib-python-headless==4.9.0.80
diffusers==0.27.2
diffusers==0.28.0
einops==0.4.1
gradio==3.43.2
huggingface_hub==0.23.2
+1 -4
View File
@@ -943,10 +943,7 @@ class StableDiffusionXLDiffImg2ImgPipeline(DiffusionPipeline, FromSingleFileMixi
and denoising_value_valid(denoising_start)
and denoising_start >= denoising_end
):
raise ValueError(
f"`denoising_start`: {denoising_start} cannot be larger than or equal to `denoising_end`: "
+ f" {denoising_end} when using type float."
)
raise ValueError(f"`denoising_start`: {denoising_start} cannot be larger than or equal to `denoising_end`: {denoising_end} when using type float.")
elif denoising_end is not None and denoising_value_valid(denoising_end):
discrete_timestep_cutoff = int(
round(
+2 -2
View File
@@ -12,11 +12,11 @@ import modules.loader
import torch # pylint: disable=wrong-import-order
from modules import timer, errors, paths # pylint: disable=unused-import
from installer import log, git_commit, custom_excepthook
import ldm.modules.encoders.modules # pylint: disable=W0611,C0411,E0401
import ldm.modules.encoders.modules # pylint: disable=unused-import, wrong-import-order
from modules import shared, extensions, gr_tempdir, modelloader # pylint: disable=ungrouped-imports
from modules import extra_networks, ui_extra_networks # pylint: disable=ungrouped-imports
from modules.paths import create_paths
from modules.call_queue import queue_lock, wrap_queued_call, wrap_gradio_gpu_call # pylint: disable=W0611,C0411,C0412
from modules.call_queue import queue_lock, wrap_queued_call, wrap_gradio_gpu_call # pylint: disable=unused-import
import modules.devices
import modules.sd_samplers
import modules.lowvram