giulio98's picture
Create README.md
080ab9b verified
|
raw
history blame
708 Bytes
metadata
datasets:
  - eurecom-ds/celeba
library_name: diffusers
pipeline_tag: unconditional-image-generation
# !pip install diffusers
from diffusers import DiffusionPipeline
import torch

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_id = "eurecom-ds/scoresdeve-ema-celeba-64"

# load model and scheduler
pipe = DiffusionPipeline.from_pretrained(model_id, trust_remote_code=True)
pipe.to(device)


# run pipeline in inference (sample random noise and denoise)
generator = torch.Generator(device=device).manual_seed(46)
image = pipe(
  generator=generator,
  batch_size=1,
  num_inference_steps=1000
).images


# save image
image[0].save("sde_ve_generated_image.png")