Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
pip install transformers accelerate -q
|
2 |
+
pip install git+https://github.com/huggingface/diffusers@@shap-ee
|
3 |
+
|
4 |
+
import torch
|
5 |
+
from diffusers import ShapEPipeline
|
6 |
+
from diffusers.utils import export_to_gif
|
7 |
+
|
8 |
+
|
9 |
+
ckpt_id = "openai/shap-e"
|
10 |
+
pipe = ShapEPipeline.from_pretrained(repo).to("cuda")
|
11 |
+
|
12 |
+
|
13 |
+
guidance_scale = 15.0
|
14 |
+
prompt = "a shark"
|
15 |
+
images = pipe(
|
16 |
+
prompt,
|
17 |
+
guidance_scale=guidance_scale,
|
18 |
+
num_inference_steps=64,
|
19 |
+
size=256,
|
20 |
+
).images
|
21 |
+
|
22 |
+
gif_path = export_to_gif(images, "shark_3d.gif")
|