Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,26 +60,18 @@ def generate(
|
|
60 |
|
61 |
if not use_img2img:
|
62 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch.float16)
|
63 |
-
pipe.enable_model_cpu_offload()
|
64 |
-
pipe.unet.set_default_attn_processor()
|
65 |
|
66 |
if use_vae:
|
67 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
68 |
pipe = DiffusionPipeline.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
69 |
-
pipe.enable_model_cpu_offload()
|
70 |
-
pipe.unet.set_default_attn_processor()
|
71 |
|
72 |
if use_img2img:
|
73 |
pipe = AutoPipelineForImage2Image.from_pretrained(model, torch_dtype=torch.float16)
|
74 |
-
pipe.enable_model_cpu_offload()
|
75 |
-
pipe.unet.set_default_attn_processor()
|
76 |
|
77 |
if use_vae:
|
78 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
79 |
pipe = AutoPipelineForImage2Image.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
80 |
-
|
81 |
-
pipe.unet.set_default_attn_processor()
|
82 |
-
|
83 |
response = requests.get(url)
|
84 |
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
85 |
init_image = init_image.resize((width, height))
|
|
|
60 |
|
61 |
if not use_img2img:
|
62 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch.float16)
|
|
|
|
|
63 |
|
64 |
if use_vae:
|
65 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
66 |
pipe = DiffusionPipeline.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
|
|
|
|
67 |
|
68 |
if use_img2img:
|
69 |
pipe = AutoPipelineForImage2Image.from_pretrained(model, torch_dtype=torch.float16)
|
|
|
|
|
70 |
|
71 |
if use_vae:
|
72 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
73 |
pipe = AutoPipelineForImage2Image.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
74 |
+
|
|
|
|
|
75 |
response = requests.get(url)
|
76 |
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
77 |
init_image = init_image.resize((width, height))
|