Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,7 +130,6 @@ def get_seed(randomize_seed: bool, seed: int) -> int:
|
|
| 130 |
def generate_and_extract_glb(
|
| 131 |
image: Image.Image,
|
| 132 |
multiimages: List[Tuple[Image.Image, str]],
|
| 133 |
-
is_multiimage: bool,
|
| 134 |
seed: int,
|
| 135 |
ss_guidance_strength: float,
|
| 136 |
ss_sampling_steps: int,
|
|
@@ -146,7 +145,7 @@ def generate_and_extract_glb(
|
|
| 146 |
The GLB filename matches the input image filename (or first image if multi-image).
|
| 147 |
"""
|
| 148 |
# Derive base filename from the first image in the batch
|
| 149 |
-
if
|
| 150 |
base_filename = getattr(image, "filename", None) or "generated_model"
|
| 151 |
else:
|
| 152 |
# Use the first uploaded image filename if available
|
|
@@ -158,12 +157,12 @@ def generate_and_extract_glb(
|
|
| 158 |
glb_path = os.path.join(CUSTOM_SAVE_DIR, glb_filename)
|
| 159 |
|
| 160 |
# Generate 3D model
|
| 161 |
-
if
|
| 162 |
outputs = pipeline.run(
|
| 163 |
image,
|
| 164 |
seed=seed,
|
| 165 |
formats=["gaussian", "mesh"],
|
| 166 |
-
preprocess_image=
|
| 167 |
sparse_structure_sampler_params={
|
| 168 |
"steps": ss_sampling_steps,
|
| 169 |
"cfg_strength": ss_guidance_strength,
|
|
@@ -178,7 +177,7 @@ def generate_and_extract_glb(
|
|
| 178 |
[img[0] for img in multiimages],
|
| 179 |
seed=seed,
|
| 180 |
formats=["gaussian", "mesh"],
|
| 181 |
-
preprocess_image=
|
| 182 |
sparse_structure_sampler_params={
|
| 183 |
"steps": ss_sampling_steps,
|
| 184 |
"cfg_strength": ss_guidance_strength,
|
|
|
|
| 130 |
def generate_and_extract_glb(
|
| 131 |
image: Image.Image,
|
| 132 |
multiimages: List[Tuple[Image.Image, str]],
|
|
|
|
| 133 |
seed: int,
|
| 134 |
ss_guidance_strength: float,
|
| 135 |
ss_sampling_steps: int,
|
|
|
|
| 145 |
The GLB filename matches the input image filename (or first image if multi-image).
|
| 146 |
"""
|
| 147 |
# Derive base filename from the first image in the batch
|
| 148 |
+
if image:
|
| 149 |
base_filename = getattr(image, "filename", None) or "generated_model"
|
| 150 |
else:
|
| 151 |
# Use the first uploaded image filename if available
|
|
|
|
| 157 |
glb_path = os.path.join(CUSTOM_SAVE_DIR, glb_filename)
|
| 158 |
|
| 159 |
# Generate 3D model
|
| 160 |
+
if image:
|
| 161 |
outputs = pipeline.run(
|
| 162 |
image,
|
| 163 |
seed=seed,
|
| 164 |
formats=["gaussian", "mesh"],
|
| 165 |
+
preprocess_image=True,
|
| 166 |
sparse_structure_sampler_params={
|
| 167 |
"steps": ss_sampling_steps,
|
| 168 |
"cfg_strength": ss_guidance_strength,
|
|
|
|
| 177 |
[img[0] for img in multiimages],
|
| 178 |
seed=seed,
|
| 179 |
formats=["gaussian", "mesh"],
|
| 180 |
+
preprocess_image=True,
|
| 181 |
sparse_structure_sampler_params={
|
| 182 |
"steps": ss_sampling_steps,
|
| 183 |
"cfg_strength": ss_guidance_strength,
|