Lifeinhockey commited on
Commit
0b9adc4
·
verified ·
1 Parent(s): c9a2d87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -298,6 +298,10 @@ def infer(
298
 
299
  generator = torch.Generator(device).manual_seed(seed)
300
 
 
 
 
 
301
  pipe_ip_adapter = StableDiffusionControlNetPipeline.from_pretrained(
302
  model_default,
303
  controlnet=controlnet,
@@ -731,4 +735,3 @@ with gr.Blocks(css=css) as demo:
731
 
732
  if __name__ == "__main__":
733
  demo.launch()
734
-
 
298
 
299
  generator = torch.Generator(device).manual_seed(seed)
300
 
301
+ # Преобразование изображений для IP-Adapter (размер 224x224)
302
+ ip_source_image = preprocess_image(ip_source_image, width, height, resize_to_224=True)
303
+ ip_adapter_image = preprocess_image(ip_adapter_image, width, height, resize_to_224=True)
304
+
305
  pipe_ip_adapter = StableDiffusionControlNetPipeline.from_pretrained(
306
  model_default,
307
  controlnet=controlnet,
 
735
 
736
  if __name__ == "__main__":
737
  demo.launch()