Skip to content

Commit ccf97d8

Browse files
tenderness-gitsir1st-inc
authored andcommitted
progress
1 parent 7f7d72d commit ccf97d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

diffsynth_engine/pipelines/hunyuan3d_shape.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import torch
2+
from typing import Optional, Callable
23
from tqdm import tqdm
34
from PIL import Image
45
from diffsynth_engine.algorithm.noise_scheduler.flow_match.recifited_flow import RecifitedFlowScheduler
@@ -179,6 +180,7 @@ def __call__(
179180
num_inference_steps: int = 50,
180181
guidance_scale: float = 7.5,
181182
seed: int = 42,
183+
progress_callback: Optional[Callable] = None, # def progress_callback(current, total, status)
182184
):
183185
image_emb = self.encode_image(image)
184186

@@ -197,4 +199,6 @@ def __call__(
197199
noise_pred, noise_pred_uncond = model_outputs.chunk(2)
198200
model_outputs = noise_pred_uncond + guidance_scale * (noise_pred - noise_pred_uncond)
199201
latents = self.sampler.step(latents, model_outputs, i)
202+
if progress_callback is not None:
203+
progress_callback(i, len(timesteps), "DENOISING")
200204
return self.decode_latents(latents)

0 commit comments

Comments
 (0)