Spaces:
Running
on
Zero
Running
on
Zero
update
Browse files
app.py
CHANGED
@@ -93,7 +93,7 @@ def change_model_fn(model_name: str) -> None:
|
|
93 |
# variant="fp16",
|
94 |
torch_dtype=torch.bfloat16,
|
95 |
feature_extractor=None
|
96 |
-
)
|
97 |
pipeline = ConceptrolIPAdapterPlusXL(pipe, "", adapter_name, device, num_tokens=16)
|
98 |
globals()["pipeline"] = pipeline
|
99 |
|
|
|
93 |
# variant="fp16",
|
94 |
torch_dtype=torch.bfloat16,
|
95 |
feature_extractor=None
|
96 |
+
).to(device)
|
97 |
pipeline = ConceptrolIPAdapterPlusXL(pipe, "", adapter_name, device, num_tokens=16)
|
98 |
globals()["pipeline"] = pipeline
|
99 |
|
ip_adapter/__pycache__/custom_pipelines.cpython-310.pyc
CHANGED
Binary files a/ip_adapter/__pycache__/custom_pipelines.cpython-310.pyc and b/ip_adapter/__pycache__/custom_pipelines.cpython-310.pyc differ
|
|
ip_adapter/__pycache__/ip_adapter.cpython-310.pyc
CHANGED
Binary files a/ip_adapter/__pycache__/ip_adapter.cpython-310.pyc and b/ip_adapter/__pycache__/ip_adapter.cpython-310.pyc differ
|
|
ip_adapter/custom_pipelines.py
CHANGED
@@ -408,7 +408,7 @@ class StableDiffusionXLCustomPipeline(StableDiffusionXLPipeline):
|
|
408 |
if not output_type == "latent":
|
409 |
# make sure the VAE is in float32 mode, as it overflows in float16
|
410 |
needs_upcasting = (
|
411 |
-
self.vae.dtype == torch.
|
412 |
)
|
413 |
|
414 |
if needs_upcasting:
|
@@ -423,7 +423,7 @@ class StableDiffusionXLCustomPipeline(StableDiffusionXLPipeline):
|
|
423 |
|
424 |
# cast back to fp16 if needed
|
425 |
if needs_upcasting:
|
426 |
-
self.vae.to(dtype=torch.
|
427 |
else:
|
428 |
image = latents
|
429 |
|
|
|
408 |
if not output_type == "latent":
|
409 |
# make sure the VAE is in float32 mode, as it overflows in float16
|
410 |
needs_upcasting = (
|
411 |
+
self.vae.dtype == torch.float16 and self.vae.config.force_upcast
|
412 |
)
|
413 |
|
414 |
if needs_upcasting:
|
|
|
423 |
|
424 |
# cast back to fp16 if needed
|
425 |
if needs_upcasting:
|
426 |
+
self.vae.to(dtype=torch.float16)
|
427 |
else:
|
428 |
image = latents
|
429 |
|