any idea why i'm getting an out of cuda

any idea why i'm getting an out of cuda memory error when i try to load my dreambooth checkpoint like this
vae = AutoencoderKL.from_single_file(vae_fp16_path, torch_dtype=torch.float16)
pipe = StableDiffusionXLPipeline.from_single_file(
pretrained_model_link_or_path=path_to_weights,
vae=vae,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True,
)
pipe.to("cuda")
vae = AutoencoderKL.from_single_file(vae_fp16_path, torch_dtype=torch.float16)
pipe = StableDiffusionXLPipeline.from_single_file(
pretrained_model_link_or_path=path_to_weights,
vae=vae,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True,
)
pipe.to("cuda")
1 Reply
Baran
BaranOP13mo ago
This works
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0",
vae=vae,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True,
)
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0",
vae=vae,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True,
)
Want results from more Discord servers?
Add your server