Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def get_example():
1024,
1024,
2.5,
1.6,
50,
0,
],
Expand All @@ -96,6 +97,7 @@ def get_example():
1024,
1024,
2.5,
1.6,
50,
0,
],
Expand All @@ -107,6 +109,7 @@ def get_example():
1024,
1024,
2.5,
1.6,
50,
0,
],
Expand All @@ -118,6 +121,7 @@ def get_example():
1024,
1024,
2.5,
1.6,
50,
0,
],
Expand All @@ -129,6 +133,7 @@ def get_example():
1024,
1024,
2.5,
1.6,
50,
222,
],
Expand All @@ -140,6 +145,7 @@ def get_example():
1024,
1024,
2.0,
1.6,
50,
0,
],
Expand All @@ -151,6 +157,7 @@ def get_example():
1024,
1024,
2,
1.6,
50,
42,
],
Expand All @@ -162,6 +169,7 @@ def get_example():
1024,
1024,
2.0,
1.6,
50,
123,
],
Expand All @@ -173,6 +181,7 @@ def get_example():
1024,
1024,
2.5,
1.6,
50,
0,
],
Expand All @@ -184,14 +193,15 @@ def get_example():
1024,
1024,
2.5,
1.6,
50,
0,
],
]
return case

def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, inference_steps, seed):
return generate_image(text, img1, img2, img3, height, width, guidance_scale, inference_steps, seed)
def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, img_guidance_scale, inference_steps, seed):
return generate_image(text, img1, img2, img3, height, width, guidance_scale, img_guidance_scale, inference_steps, seed)

description = """
OmniGen is a unified image generation model that you can use to perform various tasks, including but not limited to text-to-image generation, subject-driven generation, Identity-Preserving Generation, and image-conditioned generation.
Expand Down Expand Up @@ -231,6 +241,10 @@ def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, infe
label="Guidance Scale", minimum=1.0, maximum=10.0, value=3.0, step=0.1
)

img_guidance_scale_input = gr.Slider(
label="Image Guidance Scale", minimum=1.0, maximum=2.0, value=1.6, step=0.1
)

num_inference_steps = gr.Slider(
label="Inference Steps", minimum=1, maximum=100, value=50, step=1
)
Expand Down Expand Up @@ -261,6 +275,7 @@ def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, infe
height_input,
width_input,
guidance_scale_input,
img_guidance_scale_input,
num_inference_steps,
seed_input,
Quantization,
Expand All @@ -279,6 +294,7 @@ def run_for_examples(text, img1, img2, img3, height, width, guidance_scale, infe
height_input,
width_input,
guidance_scale_input,
img_guidance_scale_input,
num_inference_steps,
seed_input,
Quantization,
Expand Down