ktrndy commited on
Commit
0df7761
·
verified ·
1 Parent(s): daa1993

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -93,10 +93,11 @@ def infer(
93
  controlnet=controlnet,
94
  torch_dtype=torch_dtype,
95
  safety_checker=None).to(device)
 
 
96
  params['control_image'] = controlnet_image
97
  params['controlnet_conditioning_scale'] = controlnet_strength
98
- # controlnet_image = load_image(controlnet_image).convert('RGB')
99
- # print(type(controlnet_image))
100
  else:
101
  pipe = StableDiffusionPipeline.from_pretrained(model_id,
102
  torch_dtype=torch_dtype,
@@ -106,8 +107,8 @@ def infer(
106
  if ip_adapter_checkbox:
107
  pipe.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter-plus_sd15.bin")
108
  pipe.set_ip_adapter_scale(ip_adapter_scale)
 
109
  params['ip_adapter_image'] = ip_adapter_image
110
- # ip_adapter_image = load_image(ip_adapter_image).convert('RGB')
111
 
112
  pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir)
113
  pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, text_encoder_sub_dir)
 
93
  controlnet=controlnet,
94
  torch_dtype=torch_dtype,
95
  safety_checker=None).to(device)
96
+ print(type(controlnet_image))
97
+ controlnet_image = load_image(controlnet_image).convert('RGB')
98
  params['control_image'] = controlnet_image
99
  params['controlnet_conditioning_scale'] = controlnet_strength
100
+ print(type(controlnet_image))
 
101
  else:
102
  pipe = StableDiffusionPipeline.from_pretrained(model_id,
103
  torch_dtype=torch_dtype,
 
107
  if ip_adapter_checkbox:
108
  pipe.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter-plus_sd15.bin")
109
  pipe.set_ip_adapter_scale(ip_adapter_scale)
110
+ ip_adapter_image = load_image(ip_adapter_image).convert('RGB')
111
  params['ip_adapter_image'] = ip_adapter_image
 
112
 
113
  pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir)
114
  pipe.text_encoder = PeftModel.from_pretrained(pipe.text_encoder, text_encoder_sub_dir)