Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
63bfd3a
1
Parent(s):
edcfd06
This PR improves the field labels (#1)
Browse files- This PR improves the field labels (685881fc9e4a441a439df81b2926a7520015a98c)
Co-authored-by: Fabrice TIERCELIN <Fabrice-TIERCELIN@users.noreply.huggingface.co>
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,
|