Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def predict_clothing(images):
|
|
45 |
|
46 |
@spaces.GPU(duration=180)
|
47 |
def generate_image(category, img1, img2, img3, height, width, img_guidance_scale, inference_steps, seed, separate_cfg_infer, offload_model,
|
48 |
-
use_input_image_size_as_output, max_input_image_size, randomize_seed, guidance_scale=2.
|
49 |
|
50 |
print()
|
51 |
input_images = [img1, img2, img3]
|
@@ -57,10 +57,10 @@ def generate_image(category, img1, img2, img3, height, width, img_guidance_scale
|
|
57 |
wears = predict_clothing(input_images[1:])
|
58 |
if len(wears)==1:
|
59 |
dress = wears[0]
|
60 |
-
text = f"""
|
61 |
elif len(wears)==2:
|
62 |
topwear, bottomwear = wears[0], wears[1]
|
63 |
-
text = f"""
|
64 |
else:
|
65 |
input_images = None
|
66 |
|
@@ -140,8 +140,8 @@ with gr.Blocks() as demo:
|
|
140 |
category = gr.Radio(["man", "woman", "boy", "girl"], label="Category", info="Choose one category from the following")
|
141 |
|
142 |
# sliders
|
143 |
-
height_input = gr.Slider(label="Height", minimum=128, maximum=1024, value=
|
144 |
-
width_input = gr.Slider(label="Width", minimum=128, maximum=1024, value=
|
145 |
|
146 |
# guidance_scale_input = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=5.0, value=2.5, step=0.1)
|
147 |
|
@@ -151,7 +151,7 @@ with gr.Blocks() as demo:
|
|
151 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
152 |
|
153 |
with gr.Column():
|
154 |
-
max_input_image_size = gr.Slider(label="max_input_image_size", minimum=128, maximum=2048, value=
|
155 |
|
156 |
img_guidance_scale_input = gr.Slider(label="img_guidance_scale", minimum=1.0, maximum=2.0, value=1.6, step=0.1)
|
157 |
|
|
|
45 |
|
46 |
@spaces.GPU(duration=180)
|
47 |
def generate_image(category, img1, img2, img3, height, width, img_guidance_scale, inference_steps, seed, separate_cfg_infer, offload_model,
|
48 |
+
use_input_image_size_as_output, max_input_image_size, randomize_seed, guidance_scale=2.5):
|
49 |
|
50 |
print()
|
51 |
input_images = [img1, img2, img3]
|
|
|
57 |
wears = predict_clothing(input_images[1:])
|
58 |
if len(wears)==1:
|
59 |
dress = wears[0]
|
60 |
+
text = f"""The {category} in <img><|image_1|></img> wearing {dress} in <img><|image_2|></img>."""
|
61 |
elif len(wears)==2:
|
62 |
topwear, bottomwear = wears[0], wears[1]
|
63 |
+
text = f"""The {category} in <img><|image_1|></img> wearing {topwear} in <img><|image_2|></img> and {bottomwear} in <img><|image_3|></img>."""
|
64 |
else:
|
65 |
input_images = None
|
66 |
|
|
|
140 |
category = gr.Radio(["man", "woman", "boy", "girl"], label="Category", info="Choose one category from the following")
|
141 |
|
142 |
# sliders
|
143 |
+
height_input = gr.Slider(label="Height", minimum=128, maximum=1024, value=512, step=16)
|
144 |
+
width_input = gr.Slider(label="Width", minimum=128, maximum=1024, value=512, step=16)
|
145 |
|
146 |
# guidance_scale_input = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=5.0, value=2.5, step=0.1)
|
147 |
|
|
|
151 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
152 |
|
153 |
with gr.Column():
|
154 |
+
max_input_image_size = gr.Slider(label="max_input_image_size", minimum=128, maximum=2048, value=1024, step=16)
|
155 |
|
156 |
img_guidance_scale_input = gr.Slider(label="img_guidance_scale", minimum=1.0, maximum=2.0, value=1.6, step=0.1)
|
157 |
|