Spaces:
Running
on
Zero
Running
on
Zero
Alexander Bagus
commited on
Commit
·
078f16b
1
Parent(s):
c4729b7
22
Browse files
app.py
CHANGED
|
@@ -86,6 +86,7 @@ def inference(
|
|
| 86 |
prompt,
|
| 87 |
input_image,
|
| 88 |
image_scale=1.0,
|
|
|
|
| 89 |
control_context_scale = 0.75,
|
| 90 |
seed=42,
|
| 91 |
randomize_seed=True,
|
|
@@ -100,7 +101,7 @@ def inference(
|
|
| 100 |
return None
|
| 101 |
|
| 102 |
# input_image, width, height = scale_image(input_image, image_scale)
|
| 103 |
-
control_mode='HED'
|
| 104 |
|
| 105 |
if control_mode == 'HED':
|
| 106 |
processor = Processor('softedge_hed')
|
|
@@ -177,7 +178,12 @@ with gr.Blocks(css=css) as demo:
|
|
| 177 |
container=False,
|
| 178 |
)
|
| 179 |
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
with gr.Column():
|
| 182 |
output_image = gr.Image(label="Generated image", show_label=False)
|
| 183 |
polished_prompt = gr.Textbox(label="Polished prompt", interactive=False)
|
|
@@ -246,6 +252,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 246 |
polished_prompt,
|
| 247 |
input_image,
|
| 248 |
image_scale,
|
|
|
|
| 249 |
control_context_scale,
|
| 250 |
seed,
|
| 251 |
randomize_seed,
|
|
|
|
| 86 |
prompt,
|
| 87 |
input_image,
|
| 88 |
image_scale=1.0,
|
| 89 |
+
control_mode='Canny'
|
| 90 |
control_context_scale = 0.75,
|
| 91 |
seed=42,
|
| 92 |
randomize_seed=True,
|
|
|
|
| 101 |
return None
|
| 102 |
|
| 103 |
# input_image, width, height = scale_image(input_image, image_scale)
|
| 104 |
+
# control_mode='HED'
|
| 105 |
|
| 106 |
if control_mode == 'HED':
|
| 107 |
processor = Processor('softedge_hed')
|
|
|
|
| 178 |
container=False,
|
| 179 |
)
|
| 180 |
|
| 181 |
+
control_mode = gr.Radio(
|
| 182 |
+
choices=["HED", "Canny", "Midas", "MLSD", "Pose"],
|
| 183 |
+
value="Pose",
|
| 184 |
+
label="Control Mode"
|
| 185 |
+
)
|
| 186 |
+
run_button = gr.Button("Generate", variant="primary")
|
| 187 |
with gr.Column():
|
| 188 |
output_image = gr.Image(label="Generated image", show_label=False)
|
| 189 |
polished_prompt = gr.Textbox(label="Polished prompt", interactive=False)
|
|
|
|
| 252 |
polished_prompt,
|
| 253 |
input_image,
|
| 254 |
image_scale,
|
| 255 |
+
control_mode,
|
| 256 |
control_context_scale,
|
| 257 |
seed,
|
| 258 |
randomize_seed,
|