Skip to content

Commit 5f0720a

Browse files
committed
Remove no longer used code in the flux denoise function
1 parent 82b7521 commit 5f0720a

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

invokeai/app/invocations/flux_text_to_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _run_diffusion(
112112
with transformer_info as transformer:
113113
assert isinstance(transformer, Flux)
114114

115-
def step_callback(img: torch.Tensor, state: PipelineIntermediateState) -> None:
115+
def step_callback() -> None:
116116
if context.util.is_canceled():
117117
raise CanceledException
118118

invokeai/backend/flux/sampling.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def denoise(
109109
vec: Tensor,
110110
# sampling parameters
111111
timesteps: list[float],
112-
step_callback: Callable[[Tensor, PipelineIntermediateState], None],
112+
step_callback: Callable[[], None],
113113
guidance: float = 4.0,
114114
):
115115
dtype = model.txt_in.bias.dtype
@@ -123,7 +123,6 @@ def denoise(
123123

124124
# this is ignored for schnell
125125
guidance_vec = torch.full((img.shape[0],), guidance, device=img.device, dtype=img.dtype)
126-
step_count = 0
127126
for t_curr, t_prev in tqdm(list(zip(timesteps[:-1], timesteps[1:], strict=True))):
128127
t_vec = torch.full((img.shape[0],), t_curr, dtype=img.dtype, device=img.device)
129128
pred = model(
@@ -137,17 +136,7 @@ def denoise(
137136
)
138137

139138
img = img + (t_prev - t_curr) * pred
140-
step_callback(
141-
img,
142-
PipelineIntermediateState(
143-
step=step_count,
144-
order=0,
145-
total_steps=len(timesteps),
146-
timestep=math.floor(t_curr),
147-
latents=img,
148-
),
149-
)
150-
step_count += 1
139+
step_callback()
151140

152141
return img
153142

0 commit comments

Comments
 (0)