Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
tags:
|
4 |
+
- pytorch
|
5 |
+
- diffusers
|
6 |
+
- unconditional-image-generation
|
7 |
+
- diffusion-models-class
|
8 |
+
---
|
9 |
+
|
10 |
+
# Model Card for Unit 1 of the [Diffusion Models Class 🧨](https://github.com/huggingface/diffusion-models-class)
|
11 |
+
|
12 |
+
This model is a diffusion model for unconditional image generation of cute 🦋.
|
13 |
+
|
14 |
+
## Usage
|
15 |
+
|
16 |
+
```python
|
17 |
+
from diffusers import DDPMPipeline
|
18 |
+
import torch
|
19 |
+
|
20 |
+
pipeline = DDPMPipeline.from_pretrained('Chen011/sd-class-butterflies-32').to("cuda" if torch.cuda.is_available() else "cpu")
|
21 |
+
|
22 |
+
# Generate random noise
|
23 |
+
random_noise = torch.randn((1, 3, 64, 64)) # Adjust the shape as per your model's requirements
|
24 |
+
|
25 |
+
# Pass through the pipeline
|
26 |
+
image = pipeline(num_inference_steps=50, generator=torch.manual_seed(42), latents=random_noise).images[0]
|
27 |
+
image.show()
|