mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Remove no longer used code in the flux denoise function
This commit is contained in:
parent
3ea6c9666e
commit
849da67cc7
@ -112,7 +112,7 @@ class FluxTextToImageInvocation(BaseInvocation, WithMetadata, WithBoard):
|
|||||||
with transformer_info as transformer:
|
with transformer_info as transformer:
|
||||||
assert isinstance(transformer, Flux)
|
assert isinstance(transformer, Flux)
|
||||||
|
|
||||||
def step_callback(img: torch.Tensor, state: PipelineIntermediateState) -> None:
|
def step_callback() -> None:
|
||||||
if context.util.is_canceled():
|
if context.util.is_canceled():
|
||||||
raise CanceledException
|
raise CanceledException
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ def denoise(
|
|||||||
vec: Tensor,
|
vec: Tensor,
|
||||||
# sampling parameters
|
# sampling parameters
|
||||||
timesteps: list[float],
|
timesteps: list[float],
|
||||||
step_callback: Callable[[Tensor, PipelineIntermediateState], None],
|
step_callback: Callable[[], None],
|
||||||
guidance: float = 4.0,
|
guidance: float = 4.0,
|
||||||
):
|
):
|
||||||
dtype = model.txt_in.bias.dtype
|
dtype = model.txt_in.bias.dtype
|
||||||
@ -123,7 +123,6 @@ def denoise(
|
|||||||
|
|
||||||
# this is ignored for schnell
|
# this is ignored for schnell
|
||||||
guidance_vec = torch.full((img.shape[0],), guidance, device=img.device, dtype=img.dtype)
|
guidance_vec = torch.full((img.shape[0],), guidance, device=img.device, dtype=img.dtype)
|
||||||
step_count = 0
|
|
||||||
for t_curr, t_prev in tqdm(list(zip(timesteps[:-1], timesteps[1:], strict=True))):
|
for t_curr, t_prev in tqdm(list(zip(timesteps[:-1], timesteps[1:], strict=True))):
|
||||||
t_vec = torch.full((img.shape[0],), t_curr, dtype=img.dtype, device=img.device)
|
t_vec = torch.full((img.shape[0],), t_curr, dtype=img.dtype, device=img.device)
|
||||||
pred = model(
|
pred = model(
|
||||||
@ -137,17 +136,7 @@ def denoise(
|
|||||||
)
|
)
|
||||||
|
|
||||||
img = img + (t_prev - t_curr) * pred
|
img = img + (t_prev - t_curr) * pred
|
||||||
step_callback(
|
step_callback()
|
||||||
img,
|
|
||||||
PipelineIntermediateState(
|
|
||||||
step=step_count,
|
|
||||||
order=0,
|
|
||||||
total_steps=len(timesteps),
|
|
||||||
timestep=math.floor(t_curr),
|
|
||||||
latents=img,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
step_count += 1
|
|
||||||
|
|
||||||
return img
|
return img
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user