kohya-ss / sd-scripts

Apache License 2.0
5.21k stars 866 forks source link

Flux Lora producing blurry images #1572

Open nitinh12 opened 2 months ago

nitinh12 commented 2 months ago

@kohya-ss Hi, I trained a Lora for a dress on flux and it gives me blurry results. I am using it at weights 1 and 1.3 0727-hcb_white_dress_a_woman_posing_in_a_gar-flux1-dev-1149062164

b-7777777 commented 2 months ago

what training params were used? dataset size?

kohya-ss commented 2 months ago

Please try increasing the number of inference steps, say from 20 to 50.

nitinh12 commented 2 months ago

Please try increasing the number of inference steps, say from 20 to 50.

By inference steps do you mean steps during generation?

nitinh12 commented 2 months ago

what training params were used? dataset size? 740754_training_data.zip

I used this dataset

nitinh12 commented 2 months ago

what training params were used? dataset size?

And these training parameters

4x_GPU_Rank_1_SLOW_Better_Quality.json

kohya-ss commented 2 months ago

By inference steps do you mean steps during generation?

Yes, that's right.

gesen2egee commented 2 months ago

Use flux_shift as timestamp_sampling is better

nitinh12 commented 2 months ago

By inference steps do you mean steps during generation?

Yes, that's right.

I already tried 100 steps and the results are still blurry. I trained with same dataset on ai toolkit and the results were not blurry.

nitinh12 commented 2 months ago

Use flux_shift as timestamp_sampling is better

Is this a setting in the Kohya GUI?

kohya-ss commented 2 months ago

I already tried 100 steps and the results are still blurry. I trained with same dataset on ai toolkit and the results were not blurry.

If so, you may want to try multi-resolution learning, which seems to be enabled by default in the AI-toolkit. Please see https://github.com/kohya-ss/sd-scripts/tree/sd3?tab=readme-ov-file#flux1-multi-resolution-training

nitinh12 commented 2 months ago

I already tried 100 steps and the results are still blurry. I trained with same dataset on ai toolkit and the results were not blurry.

If so, you may want to try multi-resolution learning, which seems to be enabled by default in the AI-toolkit. Please see https://github.com/kohya-ss/sd-scripts/tree/sd3?tab=readme-ov-file#flux1-multi-resolution-training

I also trained on 1024×1024 but the results were still blurry.

kohya-ss commented 2 months ago

I also trained on 1024×1024 but the results were still blurry.

Is this the same if you train multiple resolutions at the same time, i.e. 512x512, 768x768 and 1024x1024?

nitinh12 commented 2 months ago

I also trained on 1024×1024 but the results were still blurry.

Is this the same if you train multiple resolutions at the same time, i.e. 512x512, 768x768 and 1024x1024?

I tried on ai toolkit and it had multi resolution on by default and the results were good so I will now try multi resolution in kohya. Can I use multi resolution in runpod using the link you provided?

kohya-ss commented 2 months ago

I tried on ai toolkit and it had multi resolution on by default and the results were good so I will now try multi resolution in kohya. Can I use multi resolution in runpod using the link you provided?

If you are currently managing your dataset config in a .toml file, this is easily possible. However, if you are using GUI from bmaltais, I don't know how to specify multi-resolution training from the GUI.

nitinh12 commented 2 months ago

I tried on ai toolkit and it had multi resolution on by default and the results were good so I will now try multi resolution in kohya. Can I use multi resolution in runpod using the link you provided?

If you are currently managing your dataset config in a .toml file, this is easily possible. However, if you are using GUI from bmaltais, I don't know how to specify multi-resolution training from the GUI.

Okay. Does multi resolution only support the resolutions you mentioned above or it can be any like 1080x1920?

kohya-ss commented 2 months ago

Okay. Does multi resolution only support the resolutions you mentioned above or it can be any like 1080x1920?

It's fine if the resolution is supported by FLUX.1. However, the training images must be high resolution. Also, since Aspect Ratio Bucketing is enabled, the resolution can be a square, such as 1280,1280.

nitinh12 commented 2 months ago

Okay. Does multi resolution only support the resolutions you mentioned above or it can be any like 1080x1920?

It's fine if the resolution is supported by FLUX.1. However, the training images must be high resolution. Also, since Aspect Ratio Bucketing is enabled, the resolution can be a square, such as 1280,1280.

Where can I see the resolutions supported by flux dev?

kohya-ss commented 2 months ago

Where can I see the resolutions supported by flux dev?

I don't think this is official, but I think it might help.

https://www.reddit.com/r/StableDiffusion/comments/1enxdga/flux_recommended_resolutions_from_01_to_20/

nitinh12 commented 2 months ago

Where can I see the resolutions supported by flux dev?

I don't think this is official, but I think it might help.

https://www.reddit.com/r/StableDiffusion/comments/1enxdga/flux_recommended_resolutions_from_01_to_20/

Thanks I will try with those resolutions.