Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ def infer(
|
|
108 |
width=512,
|
109 |
height=512,
|
110 |
num_inference_steps=50,
|
111 |
-
model='stable-diffusion-v1-5/stable-diffusion-v1-5',
|
112 |
seed=4,
|
113 |
guidance_scale=7.5,
|
114 |
lora_scale=0.7,
|
@@ -299,10 +299,8 @@ def infer(
|
|
299 |
generator = torch.Generator(device).manual_seed(seed)
|
300 |
|
301 |
# Преобразование изображений для IP-Adapter (размер 224x224)
|
302 |
-
|
303 |
-
|
304 |
-
ip_source_image = preprocess_image(ip_source_image, width, height)
|
305 |
-
ip_adapter_image = preprocess_image(ip_adapter_image, width, height)
|
306 |
|
307 |
pipe_ip_adapter = StableDiffusionControlNetPipeline.from_pretrained(
|
308 |
model_default,
|
@@ -405,7 +403,7 @@ def infer(
|
|
405 |
generator = torch.Generator(device).manual_seed(seed)
|
406 |
|
407 |
pipe_controlnet = StableDiffusionControlNetPipeline.from_pretrained(
|
408 |
-
"stable-diffusion-v1-5/stable-diffusion-v1-5",
|
409 |
controlnet=controlnet,
|
410 |
torch_dtype=torch_dtype,
|
411 |
use_safetensors=True
|
@@ -445,7 +443,7 @@ def infer(
|
|
445 |
generator = torch.Generator(device).manual_seed(seed)
|
446 |
|
447 |
pipe_controlnet = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
448 |
-
"stable-diffusion-v1-5/stable-diffusion-v1-5",
|
449 |
controlnet=controlnet,
|
450 |
torch_dtype=torch_dtype,
|
451 |
use_safetensors=True
|
|
|
108 |
width=512,
|
109 |
height=512,
|
110 |
num_inference_steps=50,
|
111 |
+
model=model_default, #'stable-diffusion-v1-5/stable-diffusion-v1-5',
|
112 |
seed=4,
|
113 |
guidance_scale=7.5,
|
114 |
lora_scale=0.7,
|
|
|
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,
|
|
|
403 |
generator = torch.Generator(device).manual_seed(seed)
|
404 |
|
405 |
pipe_controlnet = StableDiffusionControlNetPipeline.from_pretrained(
|
406 |
+
model_default, #"stable-diffusion-v1-5/stable-diffusion-v1-5",
|
407 |
controlnet=controlnet,
|
408 |
torch_dtype=torch_dtype,
|
409 |
use_safetensors=True
|
|
|
443 |
generator = torch.Generator(device).manual_seed(seed)
|
444 |
|
445 |
pipe_controlnet = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
446 |
+
model_default, #"stable-diffusion-v1-5/stable-diffusion-v1-5",
|
447 |
controlnet=controlnet,
|
448 |
torch_dtype=torch_dtype,
|
449 |
use_safetensors=True
|