Instructions to use CompVis/ldm-celebahq-256 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use CompVis/ldm-celebahq-256 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("CompVis/ldm-celebahq-256", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Decoder Output
#2
by StableDiffuser317 - opened
Hello,
After running the code I noticed the error
"
1 # process image
----> 2 image_processed = image.cpu().permute(0, 2, 3, 1)
3 image_processed = (image_processed + 1.0) * 127.5
4 image_processed = image_processed.clamp(0, 255).numpy().astype(np.uint8)
AttributeError: 'DecoderOutput' object has no attribute 'cpu'
"
It seemed to work using
image_processed = image.sample.cpu().permute(0, 2, 3, 1)
I don't really know if this is an issue but it works now