Spaces:
Sleeping
Sleeping
ahmetyaylalioglu
commited on
Commit
•
4f082c1
1
Parent(s):
8594f35
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ subprocess.run(
|
|
14 |
)
|
15 |
|
16 |
pipeline = DiffusionPipeline.from_pretrained(
|
17 |
-
"
|
18 |
-
custom_pipeline="
|
19 |
torch_dtype=torch.float16,
|
20 |
trust_remote_code=True,
|
21 |
).to("cuda")
|
@@ -24,18 +24,12 @@ pipeline = DiffusionPipeline.from_pretrained(
|
|
24 |
@spaces.GPU
|
25 |
def run(image):
|
26 |
input_image = np.array(image, dtype=np.float32) / 255.0
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
except AttributeError as e:
|
34 |
-
return f"Failed to save file due to an attribute error: {str(e)}"
|
35 |
-
except Exception as e:
|
36 |
-
return f"An error occurred: {str(e)}"
|
37 |
-
|
38 |
-
|
39 |
|
40 |
|
41 |
demo = gr.Interface(
|
@@ -50,4 +44,4 @@ demo = gr.Interface(
|
|
50 |
cache_examples=True,
|
51 |
allow_duplication=True,
|
52 |
)
|
53 |
-
demo.queue().launch()
|
|
|
14 |
)
|
15 |
|
16 |
pipeline = DiffusionPipeline.from_pretrained(
|
17 |
+
"dylanebert/LGM-full",
|
18 |
+
custom_pipeline="dylanebert/LGM-full",
|
19 |
torch_dtype=torch.float16,
|
20 |
trust_remote_code=True,
|
21 |
).to("cuda")
|
|
|
24 |
@spaces.GPU
|
25 |
def run(image):
|
26 |
input_image = np.array(image, dtype=np.float32) / 255.0
|
27 |
+
splat = pipeline(
|
28 |
+
"", input_image, guidance_scale=5, num_inference_steps=30, elevation=0
|
29 |
+
)
|
30 |
+
splat_file = "/tmp/output.ply"
|
31 |
+
pipeline.save_ply(splat, splat_file)
|
32 |
+
return splat_file
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
|
35 |
demo = gr.Interface(
|
|
|
44 |
cache_examples=True,
|
45 |
allow_duplication=True,
|
46 |
)
|
47 |
+
demo.queue().launch()
|