LuyangZ commited on
Commit
eed3e5c
·
verified ·
1 Parent(s): 00c47e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -22,17 +22,17 @@ model_id = "LuyangZ/FloorAI"
22
 
23
  # controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
24
  # controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype="auto")
25
- # controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float32)
26
- controlnet = ControlNetModel.from_pretrained(model_id, force_download=True)
27
 
28
  controlnet.to(device)
29
- # torch.cuda.empty_cache()
30
 
31
 
32
- # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float32)
33
  # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype="auto")
34
  # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float16)
35
- pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet)
36
  pipeline.safety_checker = None
37
  pipeline.requires_safety_checker = False
38
 
@@ -46,7 +46,7 @@ pipeline.scheduler = UniPCMultistepScheduler.from_config(pipeline.scheduler.conf
46
 
47
 
48
  pipeline = pipeline.to(device)
49
- # torch.cuda.empty_cache()
50
 
51
 
52
 
 
22
 
23
  # controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
24
  # controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype="auto")
25
+ controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float32, force_download=True)
26
+ # controlnet = ControlNetModel.from_pretrained(model_id, force_download=True)
27
 
28
  controlnet.to(device)
29
+ torch.cuda.empty_cache()
30
 
31
 
32
+ pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float32, force_download=True)
33
  # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype="auto")
34
  # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float16)
35
+ # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet)
36
  pipeline.safety_checker = None
37
  pipeline.requires_safety_checker = False
38
 
 
46
 
47
 
48
  pipeline = pipeline.to(device)
49
+ torch.cuda.empty_cache()
50
 
51
 
52