Create Main.py
Browse files
Main.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from diffusers import ShapEPipeline
|
3 |
+
from diffusers.utils import export_to_gif
|
4 |
+
|
5 |
+
|
6 |
+
ckpt_id = "openai/shap-e"
|
7 |
+
pipe = ShapEPipeline.from_pretrained(repo).to("cuda")
|
8 |
+
|
9 |
+
|
10 |
+
guidance_scale = 15.0
|
11 |
+
prompt = "a shark"
|
12 |
+
images = pipe(
|
13 |
+
prompt,
|
14 |
+
guidance_scale=guidance_scale,
|
15 |
+
num_inference_steps=64,
|
16 |
+
size=256,
|
17 |
+
).images
|
18 |
+
|
19 |
+
gif_path = export_to_gif(images, "shark_3d.gif")
|