From 97940ad8245fa1e2927ef5d41ab03341f2eb656f Mon Sep 17 00:00:00 2001
From: Bagheera <59658056+bghira@users.noreply.github.com>
Date: Fri, 1 Nov 2024 17:33:53 -0600
Subject: [PATCH 1/5] Update PEFT to v0.13.2
Please accept this update to PEFT which allows OmniGen to be imported by more projects.
---
requirements.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/requirements.txt b/requirements.txt
index ad98b90..6102374 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,6 +6,6 @@ jupyter==1.0.0
numpy==1.26.3
pillow==10.2.0
torch==2.3.1
-peft==0.9.0
+peft==0.13.2
diffusers==0.30.3
-timm==0.9.16
\ No newline at end of file
+timm==0.9.16
From 9aad19e7c98d814739534e6404c58388ca58ee93 Mon Sep 17 00:00:00 2001
From: Bagheera <59658056+bghira@users.noreply.github.com>
Date: Fri, 1 Nov 2024 18:07:07 -0600
Subject: [PATCH 2/5] update setup.py
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 2899e3c..f7d948e 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
'accelerate==0.26.1',
'diffusers==0.30.3',
"timm",
- "peft==0.9.0",
+ "peft==0.13.2",
"safetensors",
"setuptools"
],
From 93c149a1a5f6526a98bca5e6cff764e0a4790782 Mon Sep 17 00:00:00 2001
From: Bagheera <59658056+bghira@users.noreply.github.com>
Date: Fri, 1 Nov 2024 18:09:25 -0600
Subject: [PATCH 3/5] make requirements more broad
---
setup.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/setup.py b/setup.py
index f7d948e..abcfa24 100644
--- a/setup.py
+++ b/setup.py
@@ -15,12 +15,12 @@
include_package_data=True,
install_requires=[
'torch<2.5',
- 'transformers==4.45.2',
+ 'transformers>=4.45.2',
'datasets',
- 'accelerate==0.26.1',
- 'diffusers==0.30.3',
+ 'accelerate>=0.26.1',
+ 'diffusers>=0.30.3',
"timm",
- "peft==0.13.2",
+ "peft>=0.9.0",
"safetensors",
"setuptools"
],
From 51ad4e149af20ffe0287fe379504f52520b18f49 Mon Sep 17 00:00:00 2001
From: Shitao Xiao <2906698981@qq.com>
Date: Sat, 2 Nov 2024 14:38:47 +0800
Subject: [PATCH 4/5] Update app.py
---
app.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app.py b/app.py
index 0a78e1a..c7aaee6 100644
--- a/app.py
+++ b/app.py
@@ -281,11 +281,11 @@ def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, img_
prompt = "A woman holds a bouquet of flowers and faces the camera. Thw woman is \\<|image_1|\>\."
Tips:
-- For out of memory or time cost, you can set `offload_model=True` or refer to [./docs/inference.md#requiremented-resources](https://github.com/VectorSpaceLab/OmniGen/blob/main/docs/inference.md#requiremented-resources) to select a appropriate setting.
-- If inference time is too long when input multiple images, please try to reduce the `max_input_image_size`. More details please refer to [./docs/inference.md#requiremented-resources](https://github.com/VectorSpaceLab/OmniGen/blob/main/docs/inference.md#requiremented-resources).
+- For out-of-memory or time cost, you can set `offload_model=True` or refer to [./docs/inference.md#requiremented-resources](https://github.com/VectorSpaceLab/OmniGen/blob/main/docs/inference.md#requiremented-resources) to select a appropriate setting.
+- If inference time is too long when inputting multiple images, please try to reduce the `max_input_image_size`. For more details please refer to [./docs/inference.md#requiremented-resources](https://github.com/VectorSpaceLab/OmniGen/blob/main/docs/inference.md#requiremented-resources).
- Oversaturated: If the image appears oversaturated, please reduce the `guidance_scale`.
- Not match the prompt: If the image does not match the prompt, please try to increase the `guidance_scale`.
-- Low-quality: More detailed prompt will lead to better results.
+- Low-quality: More detailed prompts will lead to better results.
- Animate Style: If the genereate images is in animate style, you can try to add `photo` to the prompt`.
- Edit generated image. If you generate a image by omnigen and then want to edit it, you cannot use the same seed to edit this image. For example, use seed=0 to generate image, and should use seed=1 to edit this image.
- For image editing tasks, we recommend placing the image before the editing instruction. For example, use `<|image_1|> remove suit`, rather than `remove suit <|image_1|>`.
@@ -362,10 +362,10 @@ def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, img_
label="separate_cfg_infer", info="Whether to use separate inference process for different guidance. This will reduce the memory cost.", value=True,
)
offload_model = gr.Checkbox(
- label="offload_model", info="Offload model to CPU, which will significantly reduce the memory cost but slow down the generation speed. You can cancle separate_cfg_infer and set offload_model=True. If both separate_cfg_infer and offload_model be True, further reduce the memory, but slowest generation", value=False,
+ label="offload_model", info="Offload model to CPU, which will significantly reduce the memory cost but slow down the generation speed. You can cancel separate_cfg_infer and set offload_model=True. If both separate_cfg_infer and offload_model are True, further reduce the memory, but slowest generation", value=False,
)
use_input_image_size_as_output = gr.Checkbox(
- label="use_input_image_size_as_output", info="Automatically adjust the output image size to be same as input image size. For editing and controlnet task, it can make sure the output image has the same size with input image leading to better performance", value=False,
+ label="use_input_image_size_as_output", info="Automatically adjust the output image size to be same as input image size. For editing and controlnet task, it can make sure the output image has the same size as input image leading to better performance", value=False,
)
# generate
@@ -423,4 +423,4 @@ def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, img_
gr.Markdown(article)
# launch
-demo.launch()
\ No newline at end of file
+demo.launch()
From 50d24f941883d4e3d538733b1c4ce99208f2c0ed Mon Sep 17 00:00:00 2001
From: Tialo <65392801+Tialo@users.noreply.github.com>
Date: Sat, 2 Nov 2024 16:10:33 +0300
Subject: [PATCH 5/5] remove duplicate from requirements
---
requirements.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 6102374..358c613 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,7 +5,6 @@ accelerate==0.26.1
jupyter==1.0.0
numpy==1.26.3
pillow==10.2.0
-torch==2.3.1
peft==0.13.2
diffusers==0.30.3
timm==0.9.16