From d63ee3971156558f50438155b5b6b26564fdae4b Mon Sep 17 00:00:00 2001 From: linoytsaban Date: Mon, 29 Sep 2025 13:00:42 +0300 Subject: [PATCH 1/4] make qwen and kontext uv compatible --- .../train_dreambooth_lora_flux_kontext.py | 14 ++++++++++++++ .../dreambooth/train_dreambooth_lora_qwen_image.py | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py index 03c05a05e094..af1378dd07f9 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py +++ b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py @@ -14,6 +14,20 @@ # See the License for the specific language governing permissions and # limitations under the License. +# /// script +# dependencies = [ +# "diffusers @ git+https://github.com/huggingface/diffusers.git", +# "torch>=2.0.0", +# "accelerate>=0.31.0", +# "transformers>=4.41.2", +# "ftfy", +# "tensorboard", +# "Jinja2", +# "peft>=0.11.1", +# "sentencepiece", +# ] +# /// + import argparse import copy import itertools diff --git a/examples/dreambooth/train_dreambooth_lora_qwen_image.py b/examples/dreambooth/train_dreambooth_lora_qwen_image.py index feec4da712f3..b53de3993c2f 100644 --- a/examples/dreambooth/train_dreambooth_lora_qwen_image.py +++ b/examples/dreambooth/train_dreambooth_lora_qwen_image.py @@ -13,6 +13,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and +# /// script +# dependencies = [ +# "diffusers @ git+https://github.com/huggingface/diffusers.git", +# "torch>=2.0.0", +# "accelerate>=0.31.0", +# "transformers>=4.41.2", +# "ftfy", +# "tensorboard", +# "Jinja2", +# "peft>=0.11.1", +# "sentencepiece", +# ] +# /// + import argparse import copy import itertools From e3c0b96b4754a47cf125d8b69c41221208407a3e Mon Sep 17 00:00:00 2001 From: linoytsaban Date: Mon, 29 Sep 2025 17:06:22 +0300 Subject: [PATCH 2/4] add torchvision --- .../train_dreambooth_lora_flux_advanced.py | 1 + examples/dreambooth/train_dreambooth_lora_flux.py | 1 + examples/dreambooth/train_dreambooth_lora_flux_kontext.py | 1 + examples/dreambooth/train_dreambooth_lora_qwen_image.py | 1 + examples/dreambooth/train_dreambooth_lora_sana.py | 1 + 5 files changed, 5 insertions(+) diff --git a/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py b/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py index a46490e8b3bf..f5d8bf4ddc47 100644 --- a/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py +++ b/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py @@ -25,6 +25,7 @@ # "Jinja2", # "peft>=0.11.1", # "sentencepiece", +# "torchvision" # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_flux.py b/examples/dreambooth/train_dreambooth_lora_flux.py index bd3a974a17d8..03db36e3305b 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux.py +++ b/examples/dreambooth/train_dreambooth_lora_flux.py @@ -25,6 +25,7 @@ # "Jinja2", # "peft>=0.11.1", # "sentencepiece", +# "torchvision", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py index af1378dd07f9..5142d3302335 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py +++ b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py @@ -25,6 +25,7 @@ # "Jinja2", # "peft>=0.11.1", # "sentencepiece", +# "torchvision", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_qwen_image.py b/examples/dreambooth/train_dreambooth_lora_qwen_image.py index b53de3993c2f..d3d2fbeb8e99 100644 --- a/examples/dreambooth/train_dreambooth_lora_qwen_image.py +++ b/examples/dreambooth/train_dreambooth_lora_qwen_image.py @@ -24,6 +24,7 @@ # "Jinja2", # "peft>=0.11.1", # "sentencepiece", +# "torchvision", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_sana.py b/examples/dreambooth/train_dreambooth_lora_sana.py index b188a80916d7..ad7194e9c522 100644 --- a/examples/dreambooth/train_dreambooth_lora_sana.py +++ b/examples/dreambooth/train_dreambooth_lora_sana.py @@ -25,6 +25,7 @@ # "Jinja2", # "peft>=0.14.0", # "sentencepiece", +# "torchvision" # ] # /// From d015db58a625553c1bafb8e762c0c87e1ce2a9ea Mon Sep 17 00:00:00 2001 From: linoytsaban Date: Mon, 29 Sep 2025 17:53:46 +0300 Subject: [PATCH 3/4] add torchvision --- .../train_dreambooth_lora_flux_advanced.py | 3 ++- examples/dreambooth/train_dreambooth_lora_flux.py | 1 + examples/dreambooth/train_dreambooth_lora_flux_kontext.py | 1 + examples/dreambooth/train_dreambooth_lora_qwen_image.py | 1 + examples/dreambooth/train_dreambooth_lora_sana.py | 3 ++- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py b/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py index f5d8bf4ddc47..9da7e34c1d4c 100644 --- a/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py +++ b/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py @@ -25,7 +25,8 @@ # "Jinja2", # "peft>=0.11.1", # "sentencepiece", -# "torchvision" +# "torchvision", +# "datasets", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_flux.py b/examples/dreambooth/train_dreambooth_lora_flux.py index 03db36e3305b..f2e9a980e65d 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux.py +++ b/examples/dreambooth/train_dreambooth_lora_flux.py @@ -26,6 +26,7 @@ # "peft>=0.11.1", # "sentencepiece", # "torchvision", +# "datasets", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py index 5142d3302335..5fefa3582f1f 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py +++ b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py @@ -26,6 +26,7 @@ # "peft>=0.11.1", # "sentencepiece", # "torchvision", +# "datasets", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_qwen_image.py b/examples/dreambooth/train_dreambooth_lora_qwen_image.py index d3d2fbeb8e99..ee104439d980 100644 --- a/examples/dreambooth/train_dreambooth_lora_qwen_image.py +++ b/examples/dreambooth/train_dreambooth_lora_qwen_image.py @@ -25,6 +25,7 @@ # "peft>=0.11.1", # "sentencepiece", # "torchvision", +# "datasets", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_sana.py b/examples/dreambooth/train_dreambooth_lora_sana.py index ad7194e9c522..45f56249d589 100644 --- a/examples/dreambooth/train_dreambooth_lora_sana.py +++ b/examples/dreambooth/train_dreambooth_lora_sana.py @@ -25,7 +25,8 @@ # "Jinja2", # "peft>=0.14.0", # "sentencepiece", -# "torchvision" +# "torchvision", +# "datasets", # ] # /// From 999988cd91fa4384f0fe1d23d004da69c70a2e9b Mon Sep 17 00:00:00 2001 From: linoytsaban Date: Tue, 30 Sep 2025 15:04:10 +0300 Subject: [PATCH 4/4] add datasets, bitsandbytes, prodigyopt --- .../train_dreambooth_lora_flux_advanced.py | 2 ++ examples/dreambooth/train_dreambooth_lora_flux.py | 2 ++ examples/dreambooth/train_dreambooth_lora_flux_kontext.py | 2 ++ examples/dreambooth/train_dreambooth_lora_qwen_image.py | 2 ++ examples/dreambooth/train_dreambooth_lora_sana.py | 2 ++ 5 files changed, 10 insertions(+) diff --git a/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py b/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py index 9da7e34c1d4c..5aa33190d4a0 100644 --- a/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py +++ b/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py @@ -27,6 +27,8 @@ # "sentencepiece", # "torchvision", # "datasets", +# "bitsandbytes", +# "prodigyopt", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_flux.py b/examples/dreambooth/train_dreambooth_lora_flux.py index f2e9a980e65d..3b6ab814f278 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux.py +++ b/examples/dreambooth/train_dreambooth_lora_flux.py @@ -27,6 +27,8 @@ # "sentencepiece", # "torchvision", # "datasets", +# "bitsandbytes", +# "prodigyopt", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py index 5fefa3582f1f..fc6df87768ca 100644 --- a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py +++ b/examples/dreambooth/train_dreambooth_lora_flux_kontext.py @@ -27,6 +27,8 @@ # "sentencepiece", # "torchvision", # "datasets", +# "bitsandbytes", +# "prodigyopt", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_qwen_image.py b/examples/dreambooth/train_dreambooth_lora_qwen_image.py index ee104439d980..75eae92dfbd0 100644 --- a/examples/dreambooth/train_dreambooth_lora_qwen_image.py +++ b/examples/dreambooth/train_dreambooth_lora_qwen_image.py @@ -26,6 +26,8 @@ # "sentencepiece", # "torchvision", # "datasets", +# "bitsandbytes", +# "prodigyopt", # ] # /// diff --git a/examples/dreambooth/train_dreambooth_lora_sana.py b/examples/dreambooth/train_dreambooth_lora_sana.py index 45f56249d589..2b0c1ee6697d 100644 --- a/examples/dreambooth/train_dreambooth_lora_sana.py +++ b/examples/dreambooth/train_dreambooth_lora_sana.py @@ -27,6 +27,8 @@ # "sentencepiece", # "torchvision", # "datasets", +# "bitsandbytes", +# "prodigyopt", # ] # ///