|
--- |
|
datasets: |
|
- eurecom-ds/multi_dsprites |
|
library_name: diffusers |
|
pipeline_tag: unconditional-image-generation |
|
--- |
|
```python |
|
# !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-multi-dsprites-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") |
|
``` |
|
|
|
 |
|
|