gokaygokay commited on
Commit
d68a8fc
·
verified ·
1 Parent(s): fc88d1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -19,6 +19,8 @@ from trellis.pipelines import TrellisImageTo3DPipeline
19
  from trellis.representations import Gaussian, MeshExtractResult
20
  from trellis.utils import render_utils, postprocessing_utils
21
 
 
 
22
  huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
23
  # Constants
24
  MAX_SEED = np.iinfo(np.int32).max
@@ -91,7 +93,6 @@ def generate_flux_image(
91
  width: int,
92
  height: int,
93
  guidance_scale: float,
94
- num_inference_steps: int,
95
  progress: gr.Progress = gr.Progress(track_tqdm=True),
96
  ) -> Image.Image:
97
  """Generate image using Flux pipeline"""
@@ -102,7 +103,7 @@ def generate_flux_image(
102
  image = flux_pipeline(
103
  prompt=prompt,
104
  guidance_scale=guidance_scale,
105
- num_inference_steps=num_inference_steps,
106
  width=width,
107
  height=height,
108
  generator=generator,
@@ -196,7 +197,7 @@ with gr.Blocks() as demo:
196
  height = gr.Slider(512, 1024, label="Height", value=768, step=16)
197
  with gr.Row():
198
  guidance_scale = gr.Slider(0.0, 10.0, label="Guidance Scale", value=3.5, step=0.1)
199
- num_inference_steps = gr.Slider(1, 50, label="Steps", value=8, step=1)
200
 
201
  with gr.Accordion("3D Generation Settings", open=False):
202
  gr.Markdown("Stage 1: Sparse Structure Generation")
@@ -238,7 +239,7 @@ with gr.Blocks() as demo:
238
 
239
  generate_btn.click(
240
  generate_flux_image,
241
- inputs=[prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
242
  outputs=[generated_image],
243
  ).then(
244
  image_to_3d,
 
19
  from trellis.representations import Gaussian, MeshExtractResult
20
  from trellis.utils import render_utils, postprocessing_utils
21
 
22
+ NUM_INFERENCE_STEPS = 8
23
+
24
  huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
25
  # Constants
26
  MAX_SEED = np.iinfo(np.int32).max
 
93
  width: int,
94
  height: int,
95
  guidance_scale: float,
 
96
  progress: gr.Progress = gr.Progress(track_tqdm=True),
97
  ) -> Image.Image:
98
  """Generate image using Flux pipeline"""
 
103
  image = flux_pipeline(
104
  prompt=prompt,
105
  guidance_scale=guidance_scale,
106
+ num_inference_steps=NUM_INFERENCE_STEPS,
107
  width=width,
108
  height=height,
109
  generator=generator,
 
197
  height = gr.Slider(512, 1024, label="Height", value=768, step=16)
198
  with gr.Row():
199
  guidance_scale = gr.Slider(0.0, 10.0, label="Guidance Scale", value=3.5, step=0.1)
200
+ # num_inference_steps = gr.Slider(1, 50, label="Steps", value=8, step=1)
201
 
202
  with gr.Accordion("3D Generation Settings", open=False):
203
  gr.Markdown("Stage 1: Sparse Structure Generation")
 
239
 
240
  generate_btn.click(
241
  generate_flux_image,
242
+ inputs=[prompt, seed, randomize_seed, width, height, guidance_scale],
243
  outputs=[generated_image],
244
  ).then(
245
  image_to_3d,