Cognomen commited on
Commit
5a56849
Β·
1 Parent(s): a94269f

pass cuda device argument

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -23,12 +23,13 @@ conditioning_image_transforms = T.Compose(
23
  ]
24
  )
25
 
26
- cnet = ControlNetModel.from_pretrained("./models/catcon-controlnet-wd", torch_dtype=torch.float16, from_flax=True).to("cuda")
27
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
28
  "./models/wd-1-5-b2",
29
  controlnet=cnet,
30
  torch_dtype=torch.float16,
31
- ).to("cuda")
 
32
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
33
  #pipe.enable_model_cpu_offload()
34
  #pipe.enable_xformers_memory_efficient_attention()
 
23
  ]
24
  )
25
 
26
+ cnet = ControlNetModel.from_pretrained("./models/catcon-controlnet-wd", torch_dtype=torch.float16, from_flax=True, device="0")
27
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
28
  "./models/wd-1-5-b2",
29
  controlnet=cnet,
30
  torch_dtype=torch.float16,
31
+ device="0"
32
+ )
33
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
34
  #pipe.enable_model_cpu_offload()
35
  #pipe.enable_xformers_memory_efficient_attention()