Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def infer(use_custom_model, model_name, image_in, prompt, preprocessor, controln
|
|
36 |
custom_model = model_name
|
37 |
|
38 |
# This is where you load your trained weights
|
39 |
-
pipe.load_lora_weights(custom_model,
|
40 |
|
41 |
prompt = prompt
|
42 |
negative_prompt = "extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured"
|
@@ -83,6 +83,7 @@ css="""
|
|
83 |
#col-container{
|
84 |
margin: 0 auto;
|
85 |
max-width: 680px;
|
|
|
86 |
}
|
87 |
"""
|
88 |
with gr.Blocks(css=css) as demo:
|
@@ -92,11 +93,11 @@ with gr.Blocks(css=css) as demo:
|
|
92 |
Use StableDiffusion XL with ControlNet pretrained LoRas
|
93 |
|
94 |
""")
|
95 |
-
use_custom_model = gr.Checkbox(label="Use a custom model ?", value=False)
|
96 |
model_name = gr.Textbox(label="Model to use", placeholder="username/my_model")
|
97 |
image_in = gr.Image(source="upload", type="filepath")
|
98 |
prompt = gr.Textbox(label="Prompt")
|
99 |
-
preprocessor = gr.Dropdown(label="Preprocessor", choices=["canny"], value="canny")
|
100 |
guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=7.5, type="float")
|
101 |
controlnet_conditioning_scale = gr.Slider(label="Controlnet conditioning Scale", minimum=0.1, maximum=0.9, step=0.01, value=0.5, type="float")
|
102 |
seed = gr.Slider(label="seed", minimum=0, maximum=500000, step=1, value=42)
|
|
|
36 |
custom_model = model_name
|
37 |
|
38 |
# This is where you load your trained weights
|
39 |
+
pipe.load_lora_weights(custom_model, use_auth_token=True)
|
40 |
|
41 |
prompt = prompt
|
42 |
negative_prompt = "extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured"
|
|
|
83 |
#col-container{
|
84 |
margin: 0 auto;
|
85 |
max-width: 680px;
|
86 |
+
text-align: center;
|
87 |
}
|
88 |
"""
|
89 |
with gr.Blocks(css=css) as demo:
|
|
|
93 |
Use StableDiffusion XL with ControlNet pretrained LoRas
|
94 |
|
95 |
""")
|
96 |
+
use_custom_model = gr.Checkbox(label="Use a public custom model ?(optional)", value=False, info="To use a private model, you'll prefer to duplicate the space with your own access token.")
|
97 |
model_name = gr.Textbox(label="Model to use", placeholder="username/my_model")
|
98 |
image_in = gr.Image(source="upload", type="filepath")
|
99 |
prompt = gr.Textbox(label="Prompt")
|
100 |
+
preprocessor = gr.Dropdown(label="Preprocessor", choices=["canny"], value="canny", interactive=False)
|
101 |
guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=7.5, type="float")
|
102 |
controlnet_conditioning_scale = gr.Slider(label="Controlnet conditioning Scale", minimum=0.1, maximum=0.9, step=0.01, value=0.5, type="float")
|
103 |
seed = gr.Slider(label="seed", minimum=0, maximum=500000, step=1, value=42)
|