Spaces:
Running
on
Zero
Running
on
Zero
Fabrice-TIERCELIN
commited on
Commit
•
685881f
1
Parent(s):
edcfd06
This PR improves the field labels
Browse filesUses uppercase and replaces underscores by spaces
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
-
from diffusers import ControlNetModel, StableDiffusionXLControlNetImg2ImgPipeline,
|
5 |
from PIL import Image
|
6 |
import os
|
7 |
import time
|
@@ -95,14 +95,14 @@ class Img2Img:
|
|
95 |
with gr.Blocks(css=css) as demo:
|
96 |
with gr.Row():
|
97 |
with gr.Column():
|
98 |
-
self.input_image_path = gr.Image(label="
|
99 |
-
self.prompt = gr.Textbox(label="
|
100 |
-
self.negative_prompt = gr.Textbox(label="
|
101 |
-
prompt_analysis_button = gr.Button("
|
102 |
-
self.controlnet_scale = gr.Slider(minimum=0.5, maximum=1.25, value=1.0, step=0.01, label="
|
103 |
-
generate_button = gr.Button("
|
104 |
with gr.Column():
|
105 |
-
self.output_image = gr.Image(type="pil", label="
|
106 |
|
107 |
prompt_analysis_button.click(
|
108 |
self.process_prompt_analysis,
|
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
+
from diffusers import ControlNetModel, StableDiffusionXLControlNetImg2ImgPipeline, AutoencoderKL
|
5 |
from PIL import Image
|
6 |
import os
|
7 |
import time
|
|
|
95 |
with gr.Blocks(css=css) as demo:
|
96 |
with gr.Row():
|
97 |
with gr.Column():
|
98 |
+
self.input_image_path = gr.Image(label="Input image", type='filepath')
|
99 |
+
self.prompt = gr.Textbox(label="Prompt", lines=3)
|
100 |
+
self.negative_prompt = gr.Textbox(label="Negative prompt", lines=3, value="sketch, lowres, error, extra digit, fewer digits, cropped, worst quality,low quality, normal quality, jpeg artifacts, blurry")
|
101 |
+
prompt_analysis_button = gr.Button("Prompt analysis")
|
102 |
+
self.controlnet_scale = gr.Slider(minimum=0.5, maximum=1.25, value=1.0, step=0.01, label="Lineart fidelity")
|
103 |
+
generate_button = gr.Button(value="Generate", variant="primary")
|
104 |
with gr.Column():
|
105 |
+
self.output_image = gr.Image(type="pil", label="Output image")
|
106 |
|
107 |
prompt_analysis_button.click(
|
108 |
self.process_prompt_analysis,
|