Spaces:
Running
Running
Create app.py
Browse files
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")
|