Closed psynowczyk closed 1 year ago
I've pulled these changes, but I'm still getting the same error as the original poster.
Same, I tried the dev branch and the hires fix one. With and without xformers and/or no half vae.
I can't create embedings on the base model, but I can on the refiner model. Hypernetworks I can create on both.
Can't train either though, get these errors;
** Error training embedding Traceback (most recent call last): File "E:\stuff\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 532, in train_embedding loss = shared.sd_model.weighted_forward(x, cond, w)[0] / gradient_step File "E:\stuff\stable-diffusion-webui\modules\sd_hijack.py", line 132, in weighted_forward sd_model._old_get_loss = sd_model.get_loss File "E:\stuff\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1614, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'DiffusionEngine' object has no attribute 'get_loss'
`** Exception in training hypernetwork
Traceback (most recent call last):
File "E:\stuff\stable-diffusion-webui\modules\hypernetworks\hypernetwork.py", line 619, in train_hypernetwork
c = shared.sd_model.cond_stage_model(batch.cond_text).to(devices.device, non_blocking=pin_memory)
AttributeError: 'tuple' object has no attribute 'to'`
I applied these changes ,but it is still the same problem. This is the log:
Traceback (most recent call last): File "E:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict output = await app.get_blocks().process_api( File "E:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api result = await self.call_function( File "E:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function prediction = await anyio.to_thread.run_sync( File "E:\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "E:\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "E:\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run result = context.run(func, *args) File "E:\stable-diffusion-webui\modules\textual_inversion\ui.py", line 11, in create_embedding filename = modules.textual_inversion.textual_inversion.create_embedding(name, nvpt, overwrite_old, init_text=initialization_text) File "E:\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 293, in create_embedding cond_model([""]) # will send cond model to GPU if lowvram/medvram is active File "E:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "E:\stable-diffusion-webui\repositories\generative-models\sgm\modules\encoders\modules.py", line 141, in forward emb_out = embedder(batch[embedder.input_key]) TypeError: list indices must be integers or slices, not str
Hypernetworks I can create on both.
Wait, you can create hypernetworks on the SDXL model? How?
Train tab isn't planned to be supported for SDXL. https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/11757
train tab will not work.
auto also plans to deprecate the train tab in favor of an extension at some point. https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/11857#discussioncomment-6480804
Maintaining those training scripts is too exhausting of a process for me. I will not work on it and likely will do an update in some future version that removes the tab in favor of some extension. Everyone trains using kohya's scripts. Kohya's trained SD XL networks can be used in webui.
For reference, kohya's scripts do support embedding training for SDXL. https://github.com/kohya-ss/sd-scripts/blob/sdxl/train_textual_inversion.py
Closing.
For reference, kohya's scripts do support embedding training for SDXL.
That's for textual inversion, but what about hypernetworks? Is it safe to assume they are dead then? So unless someone comes along and makes an extension capable of hypernetwork training for SDXL?
I would suggest opening an issue in https://github.com/kohya-ss/sd-scripts if you still want to train hypernetworks. It supports training them, but I doubt SDXL support is going to work at the moment. https://github.com/kohya-ss/sd-scripts/blob/sdxl/finetune/hypernetwork_nai.py
My own two cents: they're a naive approach to finetuning (it requires training a entirely separate network, not really analogous to LoRA), and because they originate from the NovelAI leak documentation is very sparse around them.
Is there an existing issue for this?
What happened?
There is an error when trying to create a new embedding while SDXL checkpoint is enabled.
Steps to reproduce the problem
What should have happened?
New embedding should be created without any errors
Version or Commit where the problem happens
1.51
What Python version are you running on ?
Python 3.10.x
What platforms do you use to access the UI ?
Windows
What device are you running WebUI on?
Nvidia GPUs (RTX 20 above)
Cross attention optimization
xformers
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
List of extensions
Console logs
Additional information
This issue occurs on SDXL 1.0 but not on 1.5 model