huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
25.03k stars 5.17k forks source link

Getting problems saving text_encoder_ti when using train_dreambooth_lora_sd15_advanced #8909

Open jleehun opened 1 month ago

jleehun commented 1 month ago

Describe the bug

Hi,

I encountered an issue while training Stable Diffusion 1.5 using the script examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py.

The problem occurs when trying to save the text_encoder while also using textual inversion.

The following line of code seems to be causing the issue:

embedding_handler.save_embeddings(f"{output_dir}/{args.output_dir}_emb.safetensors")

I discovered that removing {args.output_dir} from the path resolves the problem:

embedding_handler.save_embeddings(f"{output_dir}/ti_emb.safetensors")

Are there any alternative solutions to this issue? Any insights would be appreciated.

image image

Reproduction

Use the script train_dreambooth_lora_sd15_advanced.py Enable textual inversion Attempt to save the text_encoder

Logs

No response

System Info

Who can help?

No response

asomoza commented 1 month ago

cc: @linoytsaban

DN6 commented 1 month ago

@jleehun Should be fixed with #8927