tglcourse/lsun_church_train
Viewer • Updated • 126k • 1.65k • 3
How to use pearisli/ldm-lsun-church with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("pearisli/ldm-lsun-church", torch_dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]The model was resumed for 150,000 steps starting from the LDM-KL-8 checkpoint to incorporate the attention mechanism as implemented in diffusers, which differs from the original version. It leverages the autoencoder from stable-diffusion-2-base and achieves the FID-50K score of 4.63.
Note: To use this model with diffusers, replace the file diffusers/models/unets/unet_2d.py with the unet_2d.py provided in this repository.
from diffusers import LDMPipeline
model_id = "pearisli/ldm-lsun-church"
# load model and scheduler
pipeline = LDMPipeline.from_pretrained(model_id)
# run pipeline in inference (sample random noise and denoise)
image = pipeline(num_inference_steps=200).images[0]
# save image
image.save("ldm_generated_image.png")