gokaygokay commited on
Commit
9fdbb17
1 Parent(s): 5df2e96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -114,8 +114,8 @@ download_file(
114
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
115
 
116
  # Load ControlNet model
117
- controlnet = ControlNetModel.from_pretrained(
118
- "lllyasviel/control_v11f1e_sd15_tile", torch_dtype=torch.float16
119
  )
120
 
121
  # Load the Stable Diffusion pipeline with Juggernaut Reborn model
@@ -226,15 +226,14 @@ def process_image(input_image, prompt, negative_prompt, resolution=2048, num_inf
226
  return result
227
 
228
 
229
-
230
  # Simple options
231
  simple_options = [
232
  gr.Image(type="pil", label="Input Image"),
233
- gr.Slider(minimum=2048, maximum=3072, step=512, default=2048, label="Resolution"),
234
- gr.Slider(minimum=10, maximum=100, step=10, default=20, label="Inference Steps"),
235
- gr.Slider(minimum=0.0, maximum=1.0, step=0.05, default=0.35, label="Strength"),
236
- gr.Slider(minimum=0.0, maximum=1.0, step=0.1, default=0, label="HDR"),
237
- gr.Slider(minimum=1, maximum=10, step=0.1, default=3, label="Guidance Scale")
238
  ]
239
 
240
  # Create the Gradio interface
@@ -246,4 +245,5 @@ iface = gr.Interface(
246
  description="Upload an image and adjust the settings to process it using Stable Diffusion."
247
  )
248
 
 
249
  iface.launch()
 
114
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
115
 
116
  # Load ControlNet model
117
+ controlnet = ControlNetModel.from_single_file(
118
+ "models/ControlNet/control_v11f1e_sd15_tile.pth", torch_dtype=torch.float16
119
  )
120
 
121
  # Load the Stable Diffusion pipeline with Juggernaut Reborn model
 
226
  return result
227
 
228
 
 
229
  # Simple options
230
  simple_options = [
231
  gr.Image(type="pil", label="Input Image"),
232
+ gr.Slider(minimum=2048, maximum=3072, step=512, value=2048, label="Resolution"),
233
+ gr.Slider(minimum=10, maximum=100, step=10, value=20, label="Inference Steps"),
234
+ gr.Slider(minimum=0.0, maximum=1.0, step=0.05, value=0.35, label="Strength"),
235
+ gr.Slider(minimum=0.0, maximum=1.0, step=0.1, value=0, label="HDR"),
236
+ gr.Slider(minimum=1, maximum=10, step=0.1, value=3, label="Guidance Scale")
237
  ]
238
 
239
  # Create the Gradio interface
 
245
  description="Upload an image and adjust the settings to process it using Stable Diffusion."
246
  )
247
 
248
+
249
  iface.launch()