xywwww commited on
Commit
3c14b3e
·
verified ·
1 Parent(s): f2e5893

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -4,13 +4,15 @@ import numpy as np
4
  import gradio as gr
5
  from pytorch_lightning import seed_everything
6
  from annotator.util import resize_image, HWC3
7
- from diffusers import StableDiffusionControlNetPipeline
 
 
 
8
 
9
  # Load the pipeline
10
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
11
  "CompVis/stable-diffusion-v1-4",
12
- controlnet="path/to/controlnet/model",
13
- image_encoder="path/to/image_encoder/model"
14
  ).to("cuda")
15
 
16
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, low_threshold, high_threshold):
 
4
  import gradio as gr
5
  from pytorch_lightning import seed_everything
6
  from annotator.util import resize_image, HWC3
7
+ from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
8
+
9
+ # Load the controlnet model
10
+ controlnet = ControlNetModel.from_pretrained("path/to/controlnet/model")
11
 
12
  # Load the pipeline
13
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
14
  "CompVis/stable-diffusion-v1-4",
15
+ controlnet=controlnet
 
16
  ).to("cuda")
17
 
18
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, low_threshold, high_threshold):