Spaces:
Running
on
Zero
Running
on
Zero
Prime Cai
commited on
Commit
·
f892745
1
Parent(s):
dbabfb0
remove num of images
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def generate_image(
|
|
45 |
guidance: float = 3.5,
|
46 |
i_guidance: float = 1.0,
|
47 |
t_guidance: float = 1.0,
|
48 |
-
num_images: int =
|
49 |
):
|
50 |
w, h, min_size = image.size[0], image.size[1], min(image.size)
|
51 |
image = image.crop(
|
@@ -69,7 +69,7 @@ def generate_image(
|
|
69 |
guidance_scale_real_i=i_guidance,
|
70 |
guidance_scale_real_t=t_guidance,
|
71 |
gemini_prompt=gemini_prompt,
|
72 |
-
).images
|
73 |
|
74 |
return result_image
|
75 |
|
@@ -148,10 +148,10 @@ with demo:
|
|
148 |
gr.Slider(minimum=1.0, maximum=6.0, step=0.5, value=3.5, label="guidance scale", info="Tip: start with 3.5, then gradually increase if the consistency is consistently off"),
|
149 |
gr.Slider(minimum=1.0, maximum=2.0, step=0.05, value=1.5, label="real guidance scale for image", info="Tip: increase if the image is not consistent"),
|
150 |
gr.Slider(minimum=1.0, maximum=2.0, step=0.05, value=1.0, label="real guidance scale for prompt", info="Tip: increase if the prompt is not consistent"),
|
151 |
-
gr.Slider(minimum=1, maximum=5, step=1, value=
|
152 |
],
|
153 |
-
|
154 |
-
outputs=gr.Gallery(label="Generated Images", height=544),
|
155 |
# examples=get_samples(),
|
156 |
live=False,
|
157 |
)
|
|
|
45 |
guidance: float = 3.5,
|
46 |
i_guidance: float = 1.0,
|
47 |
t_guidance: float = 1.0,
|
48 |
+
num_images: int = 1,
|
49 |
):
|
50 |
w, h, min_size = image.size[0], image.size[1], min(image.size)
|
51 |
image = image.crop(
|
|
|
69 |
guidance_scale_real_i=i_guidance,
|
70 |
guidance_scale_real_t=t_guidance,
|
71 |
gemini_prompt=gemini_prompt,
|
72 |
+
).images[0]
|
73 |
|
74 |
return result_image
|
75 |
|
|
|
148 |
gr.Slider(minimum=1.0, maximum=6.0, step=0.5, value=3.5, label="guidance scale", info="Tip: start with 3.5, then gradually increase if the consistency is consistently off"),
|
149 |
gr.Slider(minimum=1.0, maximum=2.0, step=0.05, value=1.5, label="real guidance scale for image", info="Tip: increase if the image is not consistent"),
|
150 |
gr.Slider(minimum=1.0, maximum=2.0, step=0.05, value=1.0, label="real guidance scale for prompt", info="Tip: increase if the prompt is not consistent"),
|
151 |
+
gr.Slider(minimum=1, maximum=5, step=1, value=1, label="Number of images", info="Select how many images to generate"),
|
152 |
],
|
153 |
+
outputs=gr.Image(type="pil"),
|
154 |
+
# outputs=gr.Gallery(label="Generated Images", height=544),
|
155 |
# examples=get_samples(),
|
156 |
live=False,
|
157 |
)
|