fffiloni commited on
Commit
093e5a8
1 Parent(s): 81e01f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -31,7 +31,7 @@ generator = torch.Generator(device="cuda")
31
 
32
  #pipe.enable_model_cpu_offload()
33
 
34
- def infer(use_custom_model, model_name, image_in, prompt, preprocessor, controlnet_conditioning_scale, guidance_scale, seed):
35
  if use_custom_model:
36
  custom_model = model_name
37
 
@@ -39,7 +39,7 @@ def infer(use_custom_model, model_name, image_in, prompt, preprocessor, controln
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"
43
 
44
  if preprocessor == "canny":
45
 
@@ -99,9 +99,10 @@ Use StableDiffusion XL with ControlNet pretrained LoRas
99
  with gr.Row():
100
  with gr.Column():
101
  prompt = gr.Textbox(label="Prompt")
 
102
  guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=7.5)
103
  with gr.Column():
104
- preprocessor = gr.Dropdown(label="Preprocessor", choices=["canny"], value="canny", interactive=False)
105
  controlnet_conditioning_scale = gr.Slider(label="Controlnet conditioning Scale", minimum=0.1, maximum=0.9, step=0.01, value=0.5, type="float")
106
 
107
  seed = gr.Slider(label="seed", minimum=0, maximum=500000, step=1, value=42)
@@ -111,7 +112,7 @@ Use StableDiffusion XL with ControlNet pretrained LoRas
111
 
112
  submit_btn.click(
113
  fn = infer,
114
- inputs = [use_custom_model, model_name, image_in, prompt, preprocessor, controlnet_conditioning_scale, guidance_scale, seed],
115
  outputs = [result]
116
  )
117
 
 
31
 
32
  #pipe.enable_model_cpu_offload()
33
 
34
+ def infer(use_custom_model, model_name, image_in, prompt, negative_prompt, preprocessor, controlnet_conditioning_scale, guidance_scale, seed):
35
  if use_custom_model:
36
  custom_model = model_name
37
 
 
39
  pipe.load_lora_weights(custom_model, use_auth_token=True)
40
 
41
  prompt = prompt
42
+ negative_prompt = negative_prompt
43
 
44
  if preprocessor == "canny":
45
 
 
99
  with gr.Row():
100
  with gr.Column():
101
  prompt = gr.Textbox(label="Prompt")
102
+ negative_prompt = gr.Textbox(label="Negative prompt", value="extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured")
103
  guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=7.5)
104
  with gr.Column():
105
+ preprocessor = gr.Dropdown(label="Preprocessor", choices=["canny"], value="canny", interactive=False, info="For the moment, only canny is available")
106
  controlnet_conditioning_scale = gr.Slider(label="Controlnet conditioning Scale", minimum=0.1, maximum=0.9, step=0.01, value=0.5, type="float")
107
 
108
  seed = gr.Slider(label="seed", minimum=0, maximum=500000, step=1, value=42)
 
112
 
113
  submit_btn.click(
114
  fn = infer,
115
+ inputs = [use_custom_model, model_name, image_in, prompt, negative_prompt, preprocessor, controlnet_conditioning_scale, guidance_scale, seed],
116
  outputs = [result]
117
  )
118