kohakublueleaf / a1111-sd-webui-lycoris Goto Github PK
View Code? Open in Web Editor NEWAn extension for stable-diffusion-webui to load lycoris models.
License: Apache License 2.0
An extension for stable-diffusion-webui to load lycoris models.
License: Apache License 2.0
I trying to use lora block weight (https://github.com/hako-mikan/sd-webui-lora-block-weight) to control lycoris,arguments be like <lyco:"model name":"te value":"unet value":"dyn value":"lora block weight presets">, and I wana KEEP dyn value=default,so what should I input into "dyn value" to keep it use default value?
one issue i have is with lyco
logging
for every generate it prints this:
========================================
Apply LyCORIS model: test-lora
Text encoder weight: 1.0
Unet weight: 1.0
DyLoRA Dim: None
========================================
logging
instead of print
? that way levels and formatting can be set by core appfor example:
import logging
log = logging.getLogger("lycoris")
log.info(f'any info you want to be printed during app startup, but dont print on each generate')
log.warning(f'any warnings')
log.error(f'any errrors')
log.debug(f'any extra info you want anytime you want')
in the new commit parser.py
:
parser.add_argument("--lyco-patch-lora", action="store_true", help="Patch the built-in lora. Will use the lora_dir and <lora> format, but disable the <lyco> format.", default=False)
Seems to be broken and doesn't register the arg on my machine
Causes an error loading the extension because of the reference to this cmd option in before ui load.
Hello,
I was making a test yesterday with SD.next and part of my test-cases was using lora / lyco (in anticipation of the patched version of the sd-lycoris extension) > #34
So I used this Lora here (https://civitai.com/models/45622/90s-tmnt-donatello-realistic) and the settings given at the bottom.
I had put the lora file into both models/lora and models/lycoris folder and then called the lora from the prompt alternatively using lora: and lyco:
What I found out:
Calling the lora file through lora: gives several times the same image (image A)
Calling the lora through lyco: give several times the same image (Image B)
Image A and B are fully different (none of them beautiful, but it only about a test of functionality). I wanted to ask if you have an idea, where the difference could come from? is a1111 evaluating the lora in a buggy manner?
Keeping @vladmandic in the loop.
Prompt: Photography, pink, Sports car, best quality, masterpiece, TMNTDonatello:1.9 teenage mutant ninja turtlelyco:TMNTDonatello:1
Negative prompt: Worst quality, bad quality, low effort
Steps: 26 | Sampler: DPM++ 2M SDE Karras | CFG scale: 10 | Seed: 1842838212 | Face restoration: GFPGAN | Size: 512x512 | Model hash: 6ce0161689 | Model: v1-5-pruned-emaonly | VAE: vae-ft-mse-840000-ema-pruned (1) | Denoising strength: 0.5 | Clip skip: 1 | Version: 02c9640 | Parser: Full parser | Hires upscale: 2 | Hires steps: 14 | Hires upscaler: Latent | Dynamic thresholding enabled: True | Mimic scale: 7 | Threshold percentile: 100 | Mimic mode: Power Down | Mimic scale minimum: 0 | CFG mode: Power Down | CFG scale minimum: 0 | Power scheduler value: 4
File metadata
parameters: Photography, pink, Sports car, best quality, masterpiece, TMNTDonatello:1.9 teenage mutant ninja turtlelyco:TMNTDonatello:1 Negative prompt: Worst quality, bad quality, low effort Steps: 26, Sampler: DPM++ 2M SDE Karras, CFG scale: 10, Seed: 1842838212, Face restoration: GFPGAN, Size: 512x512, Model hash: 6ce0161689, Model: v1-5-pruned-emaonly, VAE: vae-ft-mse-840000-ema-pruned (1), Denoising strength: 0.5, Clip skip: 1, Version: 02c9640, Parser: Full parser, Hires upscale: 2, Hires steps: 14, Hires upscaler: Latent, Dynamic thresholding enabled: True, Mimic scale: 7, Threshold percentile: 100, Mimic mode: Power Down, Mimic scale minimum: 0, CFG mode: Power Down, CFG scale minimum: 0, Power scheduler value: 4
when i install this extension it works for the first few moments but then everything bugs out
first problem is like the title says, when i open stable diffusion it wont let me. it will give me errors about link_preview something like that
second if i installed the extension when SD is already oepened i can see the new tab however i cant see its content even if the folder has some inside
third problem is that i wont be able to refresh but i think its linked to the first problem
While debugging the web UI looking for possible performance improvements on startup, I noticed there's an extra call made to list_available_lycos()
at the very end of lycoris.py
that seems to serve no purpose.
a1111-sd-webui-lycoris/lycoris.py
Line 789 in 1f3e452
This function is utilized in the UI module for listing and refreshing items, which should probably be the only place it exists.
a1111-sd-webui-lycoris/ui_extra_networks_lyco.py
Lines 12 to 16 in 1f3e452
Removing that call in lycoris.py
shaved off a full 2 seconds of startup time for me. Opening the extra networks UI lists all LyCORIS models just fine. Is there any reason this is included or can it be safely removed?
activating extra network lyco with arguments [<modules.extra_networks.ExtraNetworkParams object at 0x000002483580B0D0>, <modules.extra_networks.ExtraNetworkParams object at 0x000002483580B580>]: TypeError Traceback (most recent call last): File "H:\stable-diffusion-webui\modules\extra_networks.py", line 75, in activate extra_network.activate(p, extra_network_args) File "H:\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\extra_networks_lyco.py", line 61, in activate te, unet, dyn_dim = parse_args(params.items[1:]) File "H:\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\extra_networks_lyco.py", line 17, in parse_args if '=' in i: TypeError: argument of type 'float' is not iterable
-Commit: [22bcc7be]
(AUTOMATIC1111/stable-diffusion-webui@22bcc7b)
-Extension up to date
I'm really lost here. Any help or guidance will be welcomed.
Failed to load LyCORIS
Note: the test LyCORIS model is running normaly on A1111 V1.3.2, but failed on V1.4.0.
The error model is download from HERE.
reading lora D:\AI6\stable-diffusion-webui\models\Lora\Cat Ear Girl.safetensors: AssertionError, 1.14s/it]
Traceback (most recent call last):
File "D:\AI6\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\..\..\..\extensions-builtin/Lora\lora.py", line 83, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File "D:\AI6\stable-diffusion-webui\modules\sd_models.py", line 230, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{"', b"{'"), f"{filename} is not a safetensors file"
AssertionError: D:\AI6\stable-diffusion-webui\models\Lora\Cat Ear Girl.safetensors is not a safetensors file
locon load lora method | 0/12 [00:00<?, ?it/s]
locon load lora method
loading Lora D:\AI6\stable-diffusion-webui\models\Lora\Cat Ear Girl.safetensors: Exception
Traceback (most recent call last):
File "D:\AI6\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\..\..\..\extensions-builtin/Lora\lora.py", line 253, in load_loras
lora = load_lora(name, lora_on_disk)
File "D:\AI6\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\main.py", line 373, in load_lora
sd = sd_models.read_state_dict(lora_on_disk.filename)
File "D:\AI6\stable-diffusion-webui\modules\sd_models.py", line 250, in read_state_dict
pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
File "D:\AI6\stable-diffusion-webui\venv\lib\site-packages\safetensors\torch.py", line 98, in load_file
with safe_open(filename, framework="pt", device=device) as f:
Exception: Error while deserializing header: HeaderTooLarge
I am using a LORA model to generate a single image with 512x704 resolution and hires.fix 8x_NMKD-Faces_160000G upscale by 2.2 to a final 1126x1548 resoultion image.
I keep getting out of memory when doing so and this text in the command window.
return _VF.einsum(equation, operands) # type: ignore[attr-defined]
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 21.76 GiB (GPU 0; 12.00 GiB total capacity; 2.37 GiB already allocated; 7.40 GiB free; 2.46 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
Does it really require +20GB of VRAM to run that upscaler to upscale a 512x704 image by 2.2 times? Or am I reading it wrong? I don't get what the problem is or how to fix it.
basicly if a lyco is selected on quicksetting, sd_lyco, there is no option to select none back
on A1111 hypernetwork and lora both have same issue, that is fixed with AUTOMATIC1111/stable-diffusion-webui#9723
vlad applied it do his repo and due to compatibility recommended created a ticket here
I'm in colab, webui latest version
Error completing request
Arguments: ('task(cqgnfe01l9s3n65)', '\n lora:add_detail:1', 'Easynegative, bad_prompt_version2, odd eyes, (worst quality, low quality:1.2), , (pointy ear), (text), futanari, (speech bubble:1.1), white background, simple background,badhandv4 ', [], 30, 16, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.4, 2, 'Latent', 0, 0, 0, [], 0, False, {'ad_model': 'face_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_conf': 30, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_full_res': True, 'ad_inpaint_full_res_padding': 0, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_weight': 1}, {'ad_model': 'None', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_conf': 30, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_full_res': True, 'ad_inpaint_full_res_padding': 0, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_weight': 1}, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 1, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 2048, 128, True, True, True, False, False, '', 0, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, 7, 100, 'Constant', 0, 'Constant', 0, 4, False, False, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, None, 'Refresh models', <controlnet.py.UiControlNetUnit object at 0x7fa5fc16e110>, <controlnet.py.UiControlNetUnit object at 0x7fa5fc16f550>, <controlnet.py.UiControlNetUnit object at 0x7fa5fc16eaa0>, <controlnet.py.UiControlNetUnit object at 0x7fa5fc16ce20>, False, 1, 0.15, False, 'OUT', ['OUT'], 5, 0, 'Bilinear', False, 'Pooling Max', False, 'Lerp', '', '', False, False, None, True, 'NONE:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\nALL:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\nINS:1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0\nIND:1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0\nINALL:1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0\nMIDD:1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0\nOUTD:1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0\nOUTS:1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1\nOUTALL:1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1\nALL0.5:0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5', True, 0, 'values', '0,0.25,0.5,0.75,1', 'Block ID', 'IN05-OUT05', 'none', '', '0.5,1', 'BASE,IN00,IN01,IN02,IN03,IN04,IN05,IN06,IN07,IN08,IN09,IN10,IN11,M00,OUT00,OUT01,OUT02,OUT03,OUT04,OUT05,OUT06,OUT07,OUT08,OUT09,OUT10,OUT11', 1.0, 'black', '20', False, 'ATTNDEEPON:IN05-OUT05:attn:1\n\nATTNDEEPOFF:IN05-OUT05:attn:0\n\nPROJDEEPOFF:IN05-OUT05:proj:0\n\nXYZ:::1', False, False, False, 'Vertical', '1,2', '0.2', False, False, False, 'Attention', False, '0', '0', '0.4', None, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0, None, False, False, False, False, False, None, None, None, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, False, '1:1,1:2,1:2', '0:0,0:0,0:1', '0.2,0.8,0.8', 20, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, None, None, False, None, None, False, None, None, False, 50) {}
Traceback (most recent call last):
File "/content/sdw/modules/call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "/content/sdw/modules/call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "/content/sdw/modules/txt2img.py", line 56, in txt2img
processed = process_images(p)
File "/content/sdw/modules/processing.py", line 526, in process_images
res = process_images_inner(p)
File "/content/sdw/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
File "/content/sdw/modules/processing.py", line 669, in process_images_inner
uc = get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, p.steps * step_multiplier, cached_uc)
File "/content/sdw/modules/processing.py", line 608, in get_conds_with_caching
cache[1] = function(shared.sd_model, required_prompts, steps)
File "/content/sdw/modules/prompt_parser.py", line 140, in get_learned_conditioning
conds = model.get_learned_conditioning(texts)
File "/content/sdw/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 669, in get_learned_conditioning
c = self.cond_stage_model(c)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/content/sdw/modules/sd_hijack_clip.py", line 229, in forward
z = self.process_tokens(tokens, multipliers)
File "/content/sdw/modules/sd_hijack_clip.py", line 254, in process_tokens
z = self.encode_with_transformers(tokens)
File "/content/sdw/modules/sd_hijack_clip.py", line 302, in encode_with_transformers
outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-opts.CLIP_stop_at_last_layers)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 811, in forward
return self.text_model(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 721, in forward
encoder_outputs = self.encoder(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 650, in forward
layer_outputs = encoder_layer(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 379, in forward
hidden_states, attn_weights = self.self_attn(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 268, in forward
query_states = self.q_proj(hidden_states) * self.scale
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/content/sdw/extensions/sd-webui-regional-prompter/scripts/latent.py", line 472, in lora_Linear_forward
return lora_forward(self, input, torch.nn.Linear_forward_before_lora(self, input))
File "/content/sdw/extensions/sd-webui-regional-prompter/scripts/latent.py", line 399, in lora_forward
res = res + module.up(module.down(x)) * scale
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/content/sdw/extensions/sd-webui-regional-prompter/scripts/latent.py", line 472, in lora_Linear_forward
return lora_forward(self, input, torch.nn.Linear_forward_before_lora(self, input))
File "/content/sdw/extensions/a1111-sd-webui-lycoris/lycoris.py", line 734, in lyco_Linear_forward
return torch.nn.Linear_forward_before_lyco(self, input)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat2 in method wrapper_CUDA_mm)
Hey, I've never used a Lyco before but I'm getting this error:
RuntimeError: The size of tensor a (768) must match the size of tensor b (1024) at non-singleton dimension 1
Can you help me understand what I'm doing wrong? I followed the install instructions and have installed Lora's on Stable Diffusion before.
Thank you
Creating model from config: C:\Users\Mrfir\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: C:\Users\Mrfir\stable-diffusion-webui\models\Stable-diffusion\anything-v4.5.vae.pt
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(7): bad_prompt_version2, chihunhentai2, cutesexyrobutts, jojo-stand, lancer_alter-9000, mana, raita
Model loaded in 3.4s (load weights from disk: 0.9s, create model: 0.2s, apply weights to model: 0.3s, apply half(): 0.5s, load VAE: 0.3s, move model to device: 0.5s, load textual inversion embeddings: 0.7s).
Traceback (most recent call last):
File "C:\Users\Mrfir\stable-diffusion-webui\launch.py", line 361, in
start()
File "C:\Users\Mrfir\stable-diffusion-webui\launch.py", line 356, in start
webui.webui()
File "C:\Users\Mrfir\stable-diffusion-webui\webui.py", line 205, in webui
shared.demo = modules.ui.create_ui()
File "C:\Users\Mrfir\stable-diffusion-webui\modules\ui.py", line 468, in create_ui
extra_networks_ui = ui_extra_networks.create_ui(extra_networks, extra_networks_button, 'txt2img')
File "C:\Users\Mrfir\stable-diffusion-webui\modules\ui_extra_networks.py", line 175, in create_ui
page_elem = gr.HTML(page.create_html(ui.tabname))
File "C:\Users\Mrfir\stable-diffusion-webui\modules\ui_extra_networks.py", line 90, in create_html
for item in self.list_items():
File "C:\Users\Mrfir\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris-main\ui_extra_networks_lyco.py", line 21, in list_items
"preview": self.find_preview(path),
AttributeError: 'ExtraNetworksPageLyCORIS' object has no attribute 'find_preview'. Did you mean: 'link_preview'?
Traceback (most recent call last):
File "F:\stable-diffusion-webui\launch.py", line 361, in
start()
File "F:\stable-diffusion-webui\launch.py", line 356, in start
webui.webui()
File "F:\stable-diffusion-webui\webui.py", line 205, in webui
shared.demo = modules.ui.create_ui()
File "F:\stable-diffusion-webui\modules\ui.py", line 468, in create_ui
extra_networks_ui = ui_extra_networks.create_ui(extra_networks, extra_networks_button, 'txt2img')
File "F:\stable-diffusion-webui\modules\ui_extra_networks.py", line 181, in create_ui
page_elem = gr.HTML(page.create_html(ui.tabname))
File "F:\stable-diffusion-webui\modules\ui_extra_networks.py", line 94, in create_html
for item in self.list_items():
File "F:\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\ui_extra_networks_lyco.py", line 21, in list_items
"preview": self.find_preview(path),
AttributeError: 'ExtraNetworksPageLyCORIS' object has no attribute 'find_preview'. Did you mean: 'link_preview'?
Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
I had this problem today while trying to run SD through google colab.
Traceback (most recent call last):
File "/content//stable-diffusion-webui/launch.py", line 383, in
start()
File "/content//stable-diffusion-webui/launch.py", line 377, in start
webui.webui()
File "/content/stable-diffusion-webui/webui.py", line 240, in webui
shared.demo = modules.ui.create_ui()
File "/content/stable-diffusion-webui/modules/ui.py", line 468, in create_ui
extra_networks_ui = ui_extra_networks.create_ui(extra_networks, extra_networks_button, 'txt2img')
File "/content/stable-diffusion-webui/modules/ui_extra_networks.py", line 218, in create_ui
page_elem = gr.HTML(page.create_html(ui.tabname))
File "/content/stable-diffusion-webui/modules/ui_extra_networks.py", line 94, in create_html
for item in self.list_items():
File "/content/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/ui_extra_networks_lyco.py", line 33, in list_items
"sort_keys": {'default': index, **self.get_sort_keys(lyco_on_disk.filename)},
AttributeError: 'ExtraNetworksPageLyCORIS' object has no attribute 'get_sort_keys'
This falls out of line with the built-in model tabs support there.
It prevents the setting System > Load models/files in hidden directories
from being useful for LyCORIS models.
activating extra network lyco: AttributeError
Traceback (most recent call last):
File "C:\Users\XXX\stable-diffusion-webui\modules\extra_networks.py", line 85, in activate
extra_network.activate(p, [])
File "C:\Users\XXX\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\extra_networks_lyco.py", line 41, in activate
additional = shared.opts.sd_lyco
File "C:\Users\XXX\stable-diffusion-webui\modules\shared.py", line 493, in getattr
return super(Options, self).getattribute(item)
AttributeError: 'Options' object has no attribute 'sd_lyco'
I got an error when generating images after I pulled the new version of webui today (and updated all the plugins).
I install it and restart the webui process
no error
it create LyCORIS folder in ./WebUI/models/ , but I can't find "LyCORIS" tab in the extra networks page
another question
Is it that LoCon extension function all transfered to LyCORIS extension?
Is it necessary to deactivate LoCon extension?
I already had the Locon extension installed, and had no issue using Lycoris files from the regular Models/Lora folder. I'm just confused as to how this differs from this one - https://github.com/KohakuBlueleaf/a1111-sd-webui-locon
what would you like for this extension's description?
is this ok?
"Load lycoris: non-conventional rank adapters; in separate networks gallery tab."
Hi, I installed LyCORIS from "Install from URL" SECTİON İN Extentions tab on the UI. But when i put any kind of LyCORIS on it's folder that's in models/LyCORIS i can't boot up the webUI, it says that it can't read the LyCORIS' that's why it won't give me the URL that's normally been used to enter the webUI.
stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/lycoris.py", line 698, in lyco_apply_weights
self.weight += lyco_calc_updown(lyco, module, self.weight) * multiplier
RuntimeError: The size of tensor a (9) must match the size of tensor b (4) at non-singleton dimension 1
I was about to look into it myself, I am sure it is just detecting and handling for the extra dimensions of an inpainting model, but before I did, I wanted to make sure it is not a limitation of the LyCORIS algorithm itself.
I'm using https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup
I'm possibly terribly stupid, but prior to building the image, I have placed a /models/LyCORIS with 1 valid .safetensors in several places within my local drive (to be copied into the docker image) and despite putting this path within /data and within / folders, it doesn't seem to register the plugin at all.
I am able to use loras and other such things fine.
Does anyone have any advice?
File "/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/scripts/lycoris_script.py", line 4, in
import lycoris
File "/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/lycoris.py", line 15, in
import lora
ModuleNotFoundError: No module named 'lora'
LyCORIS model settings called in the past with lyco: are resurrected again when Hires. fix.
Example:
1st prompt & Hires. fix
lyco:lora-weights:0.2:1.5→
========================================
Apply LyCORIS model: lora-weights
Text encoder weight: 0.2
Unet weight: 1.5
DyLoRA Dim: None
========================================
(Here is the progress bar during hiresfix.)
========================================
Apply LyCORIS model: lora-weights
Text encoder weight: 0.2
Unet weight: 1.5
DyLoRA Dim: None
========================================
Second prompt & Hires. fix
lyco:lora-weights:1.2:2.5→
========================================
Apply LyCORIS model: lora-weights
Text encoder weight: 1.2
Unet weight: 2.5
DyLoRA Dim: None
========================================
(Here is the progress bar during hiresfix.)
========================================
Apply LyCORIS model: lora-weights
Text encoder weight: 0.2
Unet weight: 1.5
DyLoRA Dim: None
========================================
If lyco: is deleted, it will be restored during Hires.fix.
Is it because of cache settings etc?
Basically, what the title says. Try to add model to the prompt, generate picture, remove lyco part, and model will still have effect on image
I am writing an app to use A1111 on phone, and I'd like to have an API call to fetch lycoris just like the one for lora.
Is there any possibility for this to be added? Also, some shameless promotion, let me know if you'd like to try the app, it's in TestFlight at the moment 😅
Preface: Built-in lora extension is currently incapable of handling many new lora formats. Lycoris extension is capable of handling such formats very well.
Goal: Enabling a1111-sd-webui-lycoris extension to act as default lora and lycoris handler for webui
Specs: See below
(edited as per Vlad's comment below).
Lycoris is not loading when Automatic1111 is started. Tried reinstalling, but got the same error.
Error loading script: lycoris_script.py
Traceback (most recent call last):
File "C:\Users\parso\stable-diffusion-webui\modules\scripts.py", line 263, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "C:\Users\parso\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\parso\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\scripts\lycoris_script.py", line 7, in
from lyco_logger import logger
File "C:\Users\parso\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\lyco_logger.py", line 10, in
if shared.cmd_opts.lyco_debug:
AttributeError: 'Namespace' object has no attribute 'lyco_debug'
It seems that the extension crashes when the webui starts. How to fix this?
Error running preload() for D:\Users\Administrator\Desktop\My_Projects\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\a1111-sd-webui-lycoris-main\preload.py
Traceback (most recent call last):
File "D:\Users\Administrator\Desktop\My_Projects\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\modules\script_loading.py", line 27, in preload_extensions
module.preload(parser)
File "D:\Users\Administrator\Desktop\My_Projects\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\a1111-sd-webui-lycoris-main\preload.py", line 6, in preload
parser.add_argument("--lyco-dir", type=str, help="Path to directory with LyCORIS networks.", default=os.path.join(paths.models_path, 'LyCORIS'))
File "argparse.py", line 1448, in add_argument
File "argparse.py", line 1814, in _add_action
File "argparse.py", line 1650, in _add_action
File "argparse.py", line 1462, in _add_action
File "argparse.py", line 1599, in _check_conflict
File "argparse.py", line 1608, in _handle_conflict_error
argparse.ArgumentError: argument --lyco-dir: conflicting option string: --lyco-dir
Not sure if you're monitoring conversation in #20, but the latest code introduced a major performance issue.
If you already are, feel free to ignore/close this.
1
This error keeps appearing after restarting ui or opening webui user
Traceback (most recent call last):
File "G:\stable-diffusion\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "G:\stable-diffusion\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "G:\stable-diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\scripts\lycoris_script.py", line 4, in
import lycoris
File "G:\stable-diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\lycoris.py", line 795, in
list_available_lycos()
File "G:\stable-diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\lycoris.py", line 776, in list_available_lycos
os.makedirs(shared.cmd_opts.lyco_dir, exist_ok=True)
AttributeError: 'Namespace' object has no attribute 'lyco_dir'
Please add some instructions to install for new users! Or atleast some links to do so.
Since update dcb9536, I'm no longer able to open previews in my Extra Networks.
In the console I have:
AttributeError: 'ExtraNetworksPageLyCORIS' object has no attribute 'get_sort_keys'
When I disable this extension, everything is working fine again.
There is the patch sample, using the os.path.abspath for loading build-in lora always work for me.
--- extensions/a1111-sd-webui-lycoris/lycoris.py 2023-05-03 04:52:44.833373518 +0000
+++ extensions/a1111-sd-webui-lycoris/lycoris.patch.py 2023-05-03 04:52:15.677202301 +0000
@@ -11,7 +11,7 @@
now_dir = os.path.dirname(os.path.abspath(__file__))
lora_path = os.path.join(now_dir, '..', '..', 'extensions-builtin/Lora')
-sys.path.insert(0, lora_path)
+sys.path.insert(0, os.path.abspath(lora_path))
import lora
new_lora = 'lora_calc_updown' in dir(lora)
dyn | How many row you want to utilize when using dylora, if you set to 0, it will disable the dylora
i use lbw
here I understand - the weights of the text, the unet and the weights of all blocks
<lyco:"lora name":1:1:lbw=1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0>
But I don't understand what is dyn...
lyco:Model:1:0.5:dyn=13
13? - 20? -1000?
Please help
maybe it's the Network Rank (Dimension) at which the locon was made?
The inference result of A1111-SD-Webui-Locon is correct, while the inference result of A1111-SD-Webui-Lycoris is not correct.
Error loading script: lycoris_script.py
Traceback (most recent call last):
File "/content/stable-diffusion-webui/modules/scripts.py", line 256, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/content/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/content/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/scripts/lycoris_script.py", line 4, in
import lycoris
File "/content/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/lycoris.py", line 786, in
list_available_lycos()
File "/content/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris/lycoris.py", line 767, in list_available_lycos
os.makedirs(shared.cmd_opts.lyco_dir, exist_ok=True)
AttributeError: 'Namespace' object has no attribute 'lyco_dir'
I moved some LyCORIS into the folder with their preview images, and the console throw out this error. The preview images were synced by civitai-helper. And I created subfolders inside the LyCORIS folder. What can I do to fix this error?
Traceback (most recent call last):
File "K:\stable-diffusion-webui\python\lib\site-packages\gradio\routes.py", line 337, in run_predict
output = await app.get_blocks().process_api(
File "K:\stable-diffusion-webui\python\lib\site-packages\gradio\blocks.py", line 1015, in process_api
result = await self.call_function(
File "K:\stable-diffusion-webui\python\lib\site-packages\gradio\blocks.py", line 833, in call_function
prediction = await anyio.to_thread.run_sync(
File "K:\stable-diffusion-webui\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "K:\stable-diffusion-webui\python\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "K:\stable-diffusion-webui\python\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
result = context.run(func, *args)
File "K:\stable-diffusion-webui\modules\ui_extra_networks.py", line 204, in refresh
res.append(pg.create_html(ui.tabname))
File "K:\stable-diffusion-webui\modules\ui_extra_networks.py", line 94, in create_html
for item in self.list_items():
File "K:\stable-diffusion-webui\extensions\a1111-sd-webui-lycoris\ui_extra_networks_lyco.py", line 21, in list_items
"preview": self.find_preview(path),
AttributeError: 'ExtraNetworksPageLyCORIS' object has no attribute 'find_preview'
The LoRA block weight extension can normally recognize additional network calls in the form of "<lyco: name: weight: block_weight>", but the LyCORIS extension cannot correctly recognize blocks_ weight parameter, error “ ValueError: could not convert string to float: 'ALL' ” was reported.
Although the additional network can function normally, we still hope that the LyCORIS extension can avoid such false positives.
I have hundreds of safetensors files, we all got used to them working exactly the same as each other, as they should. Now I have to check one by one to see which ones are lycoris and move them to their own folder? That's ridiculous.
Previously I used a1111-sd-webui-locon which hijack the built-in lora so that I can use lora:... for lycoris as well.
Now I change to a1111-sd-webui-lycoris because I found a bug in a1111-sd-webui-locon and found that the old package was used no more.
When I use lyco:... as specified in the readme file of the new package, I found that it cannot be recognized by other packages like composable lora (https://github.com/a2569875/stable-diffusion-webui-composable-lora).
So could you also hijack built-in lora for this package as the previous one? Thanks.
I use lycoris to load the model, but it has no effect. Loading with lora will have an effect. Am I using it wrong? attach model information
"ss_sd_model_name": "v1-5-pruned-emaonly.ckpt",
"ss_resolution": "(512, 512)",
"ss_clip_skip": "2",
"ss_num_train_images": "140",
"ss_tag_frequency": {
"20_jianzhuwu": {
"jianzhuwuartstyle a small blue house with a blue roof and a sign that says " the word " on it.": 1,
"jianzhuwuartstyle a cartoon drawing of a house with a deer head on top of it.": 1,
"jianzhuwuartstyle a drawing of a house with a fish on it": 1,
"jianzhuwuartstyle a drawing of a purple house with a purple roof.": 1,
"jianzhuwuartstyle a small house with a green roof and a sign that says " the store is on the top. "": 1,
"jianzhuwuartstyle a small house with a gun on the roof": 1,
"jianzhuwuartstyle a drawing of a house with a green roof and a sign that says " pirate ".": 1
}
},
"ss_batch_size_per_device": "1",
"ss_bucket_info": "null",
"ss_bucket_no_upscale": "False",
"ss_cache_latents": "True",
"ss_caption_dropout_every_n_epochs": "0",
"ss_caption_dropout_rate": "0.0",
"ss_caption_tag_dropout_rate": "0.0",
"ss_color_aug": "False",
"ss_dataset_dirs": {
"20_jianzhuwu": {
"n_repeats": 20,
"img_count": 7
}
},
"ss_enable_bucket": "False",
"ss_epoch": "10",
"ss_face_crop_aug_range": "None",
"ss_flip_aug": "False",
"ss_full_fp16": "False",
"ss_gradient_accumulation_steps": "1",
"ss_gradient_checkpointing": "True",
"ss_keep_tokens": "0",
"ss_learning_rate": "0.0001",
"ss_lowram": "False",
"ss_lr_scheduler": "constant",
"ss_lr_warmup_steps": "0",
"ss_max_bucket_reso": "None",
"ss_max_grad_norm": "1.0",
"ss_max_token_length": "None",
"ss_max_train_steps": "1400",
"ss_min_bucket_reso": "None",
"ss_mixed_precision": "fp16",
"ss_network_alpha": "8.0",
"ss_network_args": {
"conv_dim": "4",
"conv_alpha": "1",
"algo": "lora"
},
"ss_network_dim": "8",
"ss_network_module": "lycoris.kohya",
"ss_new_sd_model_hash": "cc6cb27103417325ff94f52b7a5d2dde45a7515b25c255d8e396c90014281516",
"ss_noise_offset": "0.1",
"ss_num_batches_per_epoch": "140",
"ss_num_epochs": "10",
"ss_num_reg_images": "0",
"ss_optimizer": "bitsandbytes.optim.adamw.AdamW8bit",
"ss_output_name": "jianzhuwuArtStyle",
"ss_prior_loss_weight": "1.0",
"ss_random_crop": "False",
"ss_reg_dataset_dirs": {},
"ss_sd_model_hash": "81761151",
"ss_sd_scripts_commit_hash": "9c8c480f8e654eeb5a7d92c13b4ce04333840b0c",
"ss_seed": "1234",
"ss_session_id": "147056358",
"ss_shuffle_caption": "False",
"ss_text_encoder_lr": "5e-05",
"ss_total_batch_size": "1",
"ss_training_comment": "None",
"ss_training_finished_at": "1681105281.02053",
"ss_training_started_at": "1681103916.6504002",
"ss_unet_lr": "0.0001",
"ss_v2": "False",
"sshs_legacy_hash": "7c3adc16",
"sshs_model_hash": "4e5c0407382898ee91a2f8f839a4d2b1f9f94f119744fa7018816dfd228fb4ef"
This part here in the latest commit: f39bc55#diff-e1a87b3a2658ae7f5d1671f19913fb188fb59a0c6d69029a03baf7ce7d2ec95eR637
Removes the check if whether module.alpha
is not None
. This means that sometimes, an error is raised saying TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
. This only happens for certain Loras, not sure what that depends on. Can you bring back the None check?
Getting the following error on Vlad's fork (haven't tested base a1111) using b2a4e5f of this extension, it appears to be irrespective of which lyco is selected, prompt length, sampler, and other extensions. If there's any further information I can provide to help diagnose please let me know
Error activating extra network lyco with arguments [<modules.extra_networks.ExtraNetworkParams object at
0x0000020191F05A50>]: TypeError
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ E:\AIStuff\automatic\modules\extra_networks.py:75 in activate │
│ │
│ 74 │ │ try: │
│ ❱ 75 │ │ │ extra_network.activate(p, extra_network_args) │
│ 76 │ │ except Exception as e: │
│ │
│ E:\AIStuff\automatic\extensions-builtin\a1111-sd-webui-lycoris\extra_networks_lyco.py:69 in activate │
│ │
│ 68 │ │ │ names.append(params.items[0]) │
│ ❱ 69 │ │ │ te, unet, dyn_dim = parse_args(params.items[1:]) │
│ 70 │ │ │ if unet is None: │
│ │
│ E:\AIStuff\automatic\extensions-builtin\a1111-sd-webui-lycoris\extra_networks_lyco.py:35 in parse_args │
│ │
│ 34 │ │ else: │
│ ❱ 35 │ │ │ x = type(x) │
│ 36 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: float() argument must be a string or a real number, not 'NoneType'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.