Spaces:
Running
Running
JV A
commited on
Commit
·
f73d988
1
Parent(s):
f27f103
Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,8 @@ def generate_image(prompt, negative_prompt, scheduler, steps, width, height, res
|
|
78 |
if 'results' in response_json and isinstance(response_json['results'], list) and len(response_json['results']) > 0:
|
79 |
image_url = response_json['results'][0]
|
80 |
|
81 |
-
# Get the image from the URL
|
|
|
82 |
image = PIL.Image.open(BytesIO(image_response.content))
|
83 |
|
84 |
return image
|
@@ -92,7 +93,7 @@ iface = gr.Interface(
|
|
92 |
fn=generate_image,
|
93 |
inputs=[
|
94 |
gr.components.Textbox(label="Prompt"),
|
95 |
-
gr.components.Textbox(
|
96 |
gr.components.Dropdown(choices=[
|
97 |
"Euler a",
|
98 |
"Euler",
|
@@ -113,13 +114,13 @@ iface = gr.Interface(
|
|
113 |
"DPM++ SDE Karras",
|
114 |
"DDIM",
|
115 |
"PLMS"
|
116 |
-
], label="Scheduler",
|
117 |
-
gr.components.Slider(minimum=10, maximum=100, step=1.0,
|
118 |
-
gr.components.Slider(minimum=512, maximum=1600,
|
119 |
-
gr.components.Slider(minimum=512, maximum=1600,
|
120 |
-
gr.components.Slider(minimum=4, maximum=12, step=0.5,
|
121 |
-
gr.components.Number(label="Seed",
|
122 |
-
gr.inputs.Checkbox(label="Restore Faces",
|
123 |
],
|
124 |
outputs=gr.components.Image(),
|
125 |
title="Freedom Demonstration",
|
|
|
78 |
if 'results' in response_json and isinstance(response_json['results'], list) and len(response_json['results']) > 0:
|
79 |
image_url = response_json['results'][0]
|
80 |
|
81 |
+
# Get the image from the URL
|
82 |
+
image_response = requests.get(image_url)
|
83 |
image = PIL.Image.open(BytesIO(image_response.content))
|
84 |
|
85 |
return image
|
|
|
93 |
fn=generate_image,
|
94 |
inputs=[
|
95 |
gr.components.Textbox(label="Prompt"),
|
96 |
+
gr.components.Textbox(value="ugly, tiling, poorlydrawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft", label="Negative Prompt"),
|
97 |
gr.components.Dropdown(choices=[
|
98 |
"Euler a",
|
99 |
"Euler",
|
|
|
114 |
"DPM++ SDE Karras",
|
115 |
"DDIM",
|
116 |
"PLMS"
|
117 |
+
], label="Scheduler", value="DPM++ SDE Karras"),
|
118 |
+
gr.components.Slider(minimum=10, maximum=100, step=1.0,value=30, label="Steps"),
|
119 |
+
gr.components.Slider(minimum=512, maximum=1600, value=768, label="Width"),
|
120 |
+
gr.components.Slider(minimum=512, maximum=1600, value=768, label="Height"),
|
121 |
+
gr.components.Slider(minimum=4, maximum=12, step=0.5, value=7.0, label="CFG"),
|
122 |
+
gr.components.Number(label="Seed", value=None),
|
123 |
+
gr.inputs.Checkbox(label="Restore Faces", value=False),
|
124 |
],
|
125 |
outputs=gr.components.Image(),
|
126 |
title="Freedom Demonstration",
|