Spaces:
Running on Zero
Running on Zero
Add separate texture algorithm selector (default: multidiffusion)
Browse files
app.py
CHANGED
|
@@ -485,7 +485,8 @@ def image_to_3d(
|
|
| 485 |
tex_slat_sampling_steps: int,
|
| 486 |
tex_slat_rescale_t: float,
|
| 487 |
multiimages: List[Tuple[Image.Image, str]],
|
| 488 |
-
multiimage_algo: Literal["
|
|
|
|
| 489 |
req: gr.Request,
|
| 490 |
progress=gr.Progress(track_tqdm=True),
|
| 491 |
) -> str:
|
|
@@ -519,6 +520,7 @@ def image_to_3d(
|
|
| 519 |
}[resolution],
|
| 520 |
return_latent=True,
|
| 521 |
mode=multiimage_algo,
|
|
|
|
| 522 |
)
|
| 523 |
mesh = outputs[0]
|
| 524 |
mesh.simplify(16777216) # nvdiffrast limit
|
|
@@ -690,7 +692,8 @@ with gr.Blocks(delete_cache=(600, 600), theme=gr.themes.Soft(primary_hue="orange
|
|
| 690 |
tex_slat_guidance_rescale = gr.Slider(0.0, 1.0, label="Guidance Rescale", value=0.0, step=0.01)
|
| 691 |
tex_slat_sampling_steps = gr.Slider(1, 50, label="Sampling Steps", value=12, step=1)
|
| 692 |
tex_slat_rescale_t = gr.Slider(1.0, 6.0, label="Rescale T", value=3.0, step=0.1)
|
| 693 |
-
multiimage_algo = gr.Radio(["stochastic", "multidiffusion"], label="
|
|
|
|
| 694 |
|
| 695 |
with gr.Column(scale=10):
|
| 696 |
preview_output = gr.HTML(empty_html, label="3D Asset Preview", show_label=True, container=True)
|
|
@@ -729,7 +732,7 @@ with gr.Blocks(delete_cache=(600, 600), theme=gr.themes.Soft(primary_hue="orange
|
|
| 729 |
ss_guidance_strength, ss_guidance_rescale, ss_sampling_steps, ss_rescale_t,
|
| 730 |
shape_slat_guidance_strength, shape_slat_guidance_rescale, shape_slat_sampling_steps, shape_slat_rescale_t,
|
| 731 |
tex_slat_guidance_strength, tex_slat_guidance_rescale, tex_slat_sampling_steps, tex_slat_rescale_t,
|
| 732 |
-
multiimage_prompt, multiimage_algo
|
| 733 |
],
|
| 734 |
outputs=[output_buf, preview_output],
|
| 735 |
)
|
|
|
|
| 485 |
tex_slat_sampling_steps: int,
|
| 486 |
tex_slat_rescale_t: float,
|
| 487 |
multiimages: List[Tuple[Image.Image, str]],
|
| 488 |
+
multiimage_algo: Literal["stochastic", "multidiffusion"],
|
| 489 |
+
tex_multiimage_algo: Literal["stochastic", "multidiffusion"],
|
| 490 |
req: gr.Request,
|
| 491 |
progress=gr.Progress(track_tqdm=True),
|
| 492 |
) -> str:
|
|
|
|
| 520 |
}[resolution],
|
| 521 |
return_latent=True,
|
| 522 |
mode=multiimage_algo,
|
| 523 |
+
tex_mode=tex_multiimage_algo,
|
| 524 |
)
|
| 525 |
mesh = outputs[0]
|
| 526 |
mesh.simplify(16777216) # nvdiffrast limit
|
|
|
|
| 692 |
tex_slat_guidance_rescale = gr.Slider(0.0, 1.0, label="Guidance Rescale", value=0.0, step=0.01)
|
| 693 |
tex_slat_sampling_steps = gr.Slider(1, 50, label="Sampling Steps", value=12, step=1)
|
| 694 |
tex_slat_rescale_t = gr.Slider(1.0, 6.0, label="Rescale T", value=3.0, step=0.1)
|
| 695 |
+
multiimage_algo = gr.Radio(["stochastic", "multidiffusion"], label="Structure Algorithm", value="stochastic")
|
| 696 |
+
tex_multiimage_algo = gr.Radio(["stochastic", "multidiffusion"], label="Texture Algorithm", value="multidiffusion")
|
| 697 |
|
| 698 |
with gr.Column(scale=10):
|
| 699 |
preview_output = gr.HTML(empty_html, label="3D Asset Preview", show_label=True, container=True)
|
|
|
|
| 732 |
ss_guidance_strength, ss_guidance_rescale, ss_sampling_steps, ss_rescale_t,
|
| 733 |
shape_slat_guidance_strength, shape_slat_guidance_rescale, shape_slat_sampling_steps, shape_slat_rescale_t,
|
| 734 |
tex_slat_guidance_strength, tex_slat_guidance_rescale, tex_slat_sampling_steps, tex_slat_rescale_t,
|
| 735 |
+
multiimage_prompt, multiimage_algo, tex_multiimage_algo
|
| 736 |
],
|
| 737 |
outputs=[output_buf, preview_output],
|
| 738 |
)
|