Closed mauricio-repetto closed 1 year ago
Training the text encoder is not yet supported, try removing the „—train-text-encoder“.
Oh and you have to use the special sdxl training scripts as the architecture differs slightly between xl and previous versions
Thanks @BitPhinix! I did not realize about the sdxl, and yes I was affraid of an issue regarding the architectural differences.. but I'm seeing that's only available for lora, is it because of a matter of the computational power needed to run a normal dreambooth finetuning? like we won't give you a regular script for xl because you, simple mortal, won't stand a chance to run it anyways :P
Hi,
Yeah we decided to only add support DreamBooth LoRA for SDXL because of the computational constraints that the community might face and we empathize with that.
Our instructions are here: https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/README_sdxl.md
We are also adding support for training the text encoder: https://github.com/huggingface/diffusers/pull/4097
Awesome, thanks paul.
Our instructions are here: https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/README_sdxl.md I am so sorry for kinda hijacking, but I don't want to create a separate issue as I am sure it's something pretty straightforward. If I train SDXL LoRa using train_dreambooth_lora_sdxl.py and it outputs a bin file, how are you supposed to transform it to a .safetensors format so I can load it just like pipe.load_lora_weights("./loras", weight_name="lora.safetensors") ? Is there a script somewhere I and I missed it?
Also, is such LoRa from dreambooth supposed to work in ComfyUI?
Also, what "-style" LoRAs does the dreambooth training create?
Hi @genesiscz, why are you trying to transform it while using diffusers? just use the file directly
...
lora_model_id = "/content/bin_folder/" # path to your .bin file's folder.
base_model_id = "stabilityai/stable-diffusion-xl-base-1.0"
pipe = DiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
pipe.load_lora_weights(lora_model_id)
...
I don't use ComfyUI so I cannot answer that question.
Regarding the style I think it should be mostly based on the prompt that you use, remember that with dreambooth you are teaching a new concept to the model without retraining everything from scratch (and with loRa you do it in a very efficient way if you are low in resources), so it's just another regular DM with additional concepts. And with XL you also have the refiner model which can also give you a few additional improvements (or not).
Hope it helps!
You're actually right, I can do that. But in order to be able to place it to A1111 or ComfyUI, they need it in safetensors format.
I meant style such as Kohya, Loha, Lycoris, I guess it's a different algorithm/structure of the LoRa (I am really a newbie in this area). I want to know what "style" or whatever is that called this Lora that are being trained with diffusers is, because I want to properly ask on ComfyUI's.
Thanks!
Oh I see it now, yes in that case I guess there should be a workaround for that but I don't know it.
Regarding the "style" (I think it is more of an implementation), yes, those are different approaches based on LoRa, in this case I'm not into the details but I would guess that it's not far from the original paper.
Hi.
I prepared a Colab Notebook here that shows how to convert a .bin
file .safetensors
format.
I meant style such as Kohya, Loha, Lycoris, I guess it's a different algorithm/structure of the LoRa (I am really a newbie in this area). I want to know what "style" or whatever is that called this Lora that are being trained with diffusers is, because I want to properly ask on ComfyUI's.
LyCORIS is a repository that provides adapter utilities beyond convention methods as far as I know. LoCon is LoRA with Convs. LoHA is a separate method.
Kohya provides useful trainers for training adapter-based models for Stable Diffusion (again as far as I know).
By LyCORIS or Kohya "styled" checkpoints, I essentially mean that the checkpoints are formatted a little differently from what we have in diffusers
. I hope this clarifies your doubt.
Describe the bug
Hi,
Is this model available for dreambooth? I'm not sure wether to put this as an issue or a feature request, but I've tried to run the regular script for the XL model to see how good it is in comparison with the other sd versions but I'm getting an error :'(
I know that XL's architecture may be different from previous SDs so maybe the script is not prepared to use it yet.
Thanks!
Reproduction
!accelerate launch train_dreambooth.py \ --pretrained_model_name_or_path="stabilityai/stable-diffusion-xl-base-0.9" \ --instance_data_dir="./pneumoconiosis" \ --class_data_dir="./data/xray" \ --output_dir="./diffusion/pneumoconiosis/models/stable-diffusion-xl-pneumoconiosis-finetuned" \ --train_text_encoder \ --mixed_precision="fp16" \ --with_prior_preservation --prior_loss_weight=1.0 \ --instance_prompt="image of a pneumoconiosis xray" \ --class_prompt="image of a xray" \ --resolution=512 \ --train_batch_size=1 \ --gradient_accumulation_steps=2 --gradient_checkpointing \ --use_8bit_adam \ --learning_rate=5e-6 \ --lr_scheduler="constant" \ --lr_warmup_steps=0 \ --num_class_images=200 \ --max_train_steps=11400 \ --checkpointing_steps=4000 \ --num_validation_images=4 \ --report_to="wandb" \ --seed=1337
Logs
System Info
Who can help?
@patrickvonplaten @sayakpaul @williamberman