Nikhil0987 commited on
Commit
f3a96d9
·
verified ·
1 Parent(s): bca5283

Create app.py

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