Spaces:
Runtime error
Runtime error
Commit
·
d315a84
1
Parent(s):
ff99100
Update space
Browse files
app.py
CHANGED
@@ -22,13 +22,12 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
22 |
MAX_IMAGE_SIZE = 1024
|
23 |
|
24 |
@spaces.GPU(duration=30)
|
25 |
-
def infer(image, edit_instruction, guidance_scale,
|
26 |
image = Image.fromarray(image).resize((512, 512))
|
27 |
image = pipe(prompt=edit_instruction,
|
28 |
image=image,
|
29 |
num_inference_steps=n_steps,
|
30 |
guidance_scale=guidance_scale,
|
31 |
-
image_guidance_scale=image_guidance_scale,
|
32 |
).images[0]
|
33 |
|
34 |
return image
|
@@ -80,19 +79,11 @@ with gr.Blocks(css=css) as demo:
|
|
80 |
guidance_scale = gr.Slider(
|
81 |
label="guidance scale",
|
82 |
minimum=1.0,
|
83 |
-
maximum=
|
84 |
step=1.0,
|
85 |
value=2.0,
|
86 |
)
|
87 |
|
88 |
-
image_guidance_scale = gr.Slider(
|
89 |
-
label="image guidance scale",
|
90 |
-
minimum=1.0,
|
91 |
-
maximum=8.0,
|
92 |
-
step=1.0,
|
93 |
-
value=1.0,
|
94 |
-
)
|
95 |
-
|
96 |
n_steps = gr.Slider(
|
97 |
label="inference steps",
|
98 |
minimum=1.0,
|
@@ -247,7 +238,7 @@ with gr.Blocks(css=css) as demo:
|
|
247 |
|
248 |
run_button.click(
|
249 |
fn = infer,
|
250 |
-
inputs=[image, edit_instruction, guidance_scale,
|
251 |
outputs = [result]
|
252 |
)
|
253 |
|
|
|
22 |
MAX_IMAGE_SIZE = 1024
|
23 |
|
24 |
@spaces.GPU(duration=30)
|
25 |
+
def infer(image, edit_instruction, guidance_scale, n_steps):
|
26 |
image = Image.fromarray(image).resize((512, 512))
|
27 |
image = pipe(prompt=edit_instruction,
|
28 |
image=image,
|
29 |
num_inference_steps=n_steps,
|
30 |
guidance_scale=guidance_scale,
|
|
|
31 |
).images[0]
|
32 |
|
33 |
return image
|
|
|
79 |
guidance_scale = gr.Slider(
|
80 |
label="guidance scale",
|
81 |
minimum=1.0,
|
82 |
+
maximum=5.0,
|
83 |
step=1.0,
|
84 |
value=2.0,
|
85 |
)
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
n_steps = gr.Slider(
|
88 |
label="inference steps",
|
89 |
minimum=1.0,
|
|
|
238 |
|
239 |
run_button.click(
|
240 |
fn = infer,
|
241 |
+
inputs=[image, edit_instruction, guidance_scale, n_steps],
|
242 |
outputs = [result]
|
243 |
)
|
244 |
|