Spaces:
Runtime error
Runtime error
Update app.py
Browse filesinserting functions to Blocks
app.py
CHANGED
@@ -31,23 +31,6 @@ pipe_inversion.scheduler_inference = scheduler_class.from_config(pipe_inference.
|
|
31 |
# image = editor.edit(target_prompt)
|
32 |
# return image
|
33 |
|
34 |
-
@spaces.GPU
|
35 |
-
def set_pipe(input_image, description_prompt, edit_guidance_scale, num_inference_steps=4,
|
36 |
-
num_inversion_steps=4, inversion_max_step=0.6, rnri_iterations=2, rnri_alpha=0.1, rnri_lr=0.2):
|
37 |
-
config = RunConfig(num_inference_steps=num_inference_steps,
|
38 |
-
num_inversion_steps=num_inversion_steps,
|
39 |
-
edit_guidance_scale=edit_guidance_scale,
|
40 |
-
inversion_max_step=inversion_max_step)
|
41 |
-
return ImageEditorDemo(pipe_inversion, pipe_inference, input_image,
|
42 |
-
description_prompt, config, device,
|
43 |
-
[rnri_iterations, rnri_alpha, rnri_lr]), "Input has set!"
|
44 |
-
|
45 |
-
@spaces.GPU
|
46 |
-
def edit(editor, target_prompt):
|
47 |
-
if editor is None:
|
48 |
-
raise gr.Error("Set inputs before editing.")
|
49 |
-
return editor.edit(target_prompt)
|
50 |
-
|
51 |
# examples = [
|
52 |
# "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
|
53 |
# "An astronaut riding a green horse",
|
@@ -79,6 +62,23 @@ with gr.Blocks(css="style.css") as demo:
|
|
79 |
""")
|
80 |
editor_state = gr.State()
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
gr.Markdown(f"""running on {power_device}""")
|
83 |
with gr.Row():
|
84 |
with gr.Column(elem_id="col-container-1"):
|
|
|
31 |
# image = editor.edit(target_prompt)
|
32 |
# return image
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
# examples = [
|
35 |
# "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
|
36 |
# "An astronaut riding a green horse",
|
|
|
62 |
""")
|
63 |
editor_state = gr.State()
|
64 |
|
65 |
+
@spaces.GPU
|
66 |
+
def set_pipe(input_image, description_prompt, edit_guidance_scale, num_inference_steps=4,
|
67 |
+
num_inversion_steps=4, inversion_max_step=0.6, rnri_iterations=2, rnri_alpha=0.1, rnri_lr=0.2):
|
68 |
+
config = RunConfig(num_inference_steps=num_inference_steps,
|
69 |
+
num_inversion_steps=num_inversion_steps,
|
70 |
+
edit_guidance_scale=edit_guidance_scale,
|
71 |
+
inversion_max_step=inversion_max_step)
|
72 |
+
return ImageEditorDemo(pipe_inversion, pipe_inference, input_image,
|
73 |
+
description_prompt, config, device,
|
74 |
+
[rnri_iterations, rnri_alpha, rnri_lr]), "Input has set!"
|
75 |
+
|
76 |
+
@spaces.GPU
|
77 |
+
def edit(editor, target_prompt):
|
78 |
+
if editor is None:
|
79 |
+
raise gr.Error("Set inputs before editing.")
|
80 |
+
return editor.edit(target_prompt)
|
81 |
+
|
82 |
gr.Markdown(f"""running on {power_device}""")
|
83 |
with gr.Row():
|
84 |
with gr.Column(elem_id="col-container-1"):
|