xywwww commited on
Commit
7eb2bf1
·
verified ·
1 Parent(s): c54b0c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -6,13 +6,17 @@ 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("CompVis/controlnet")
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):
 
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("CompVis/controlnet")
11
 
12
+ # # Load the pipeline
13
+ # pipe = StableDiffusionControlNetPipeline.from_pretrained(
14
+ # "CompVis/stable-diffusion-v1-4",
15
+ # controlnet=controlnet
16
+ # ).to("cuda")
17
+ controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16)
18
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
19
+ "runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16
 
20
  ).to("cuda")
21
 
22
  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):