mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-01-20 10:58:06 -05:00
Fractional denoise start.
This commit is contained in:
@@ -143,7 +143,9 @@ class FluxDenoiseInvocation(BaseInvocation, WithMetadata, WithBoard):
|
||||
)
|
||||
|
||||
# Clip the timesteps schedule based on denoising_start and denoising_end.
|
||||
timesteps = clip_timestep_schedule(timesteps, self.denoising_start, self.denoising_end)
|
||||
# HACK(ryand): This should be applied in the frontend.
|
||||
denoising_start = 1.0 - (1.0 - self.denoising_start) ** 0.2
|
||||
timesteps = clip_timestep_schedule(timesteps, denoising_start, self.denoising_end)
|
||||
|
||||
# Prepare input latent image.
|
||||
if init_latents is not None:
|
||||
@@ -193,7 +195,8 @@ class FluxDenoiseInvocation(BaseInvocation, WithMetadata, WithBoard):
|
||||
traj_guidance_extension = TrajectoryGuidanceExtension(
|
||||
init_latents=init_latents,
|
||||
inpaint_mask=inpaint_mask,
|
||||
trajectory_guidance_strength=self.trajectory_guidance_strength,
|
||||
# HACK(ryand): This should not be hardcoded.
|
||||
trajectory_guidance_strength=0,
|
||||
)
|
||||
|
||||
with (
|
||||
|
||||
@@ -92,7 +92,9 @@ def clip_timestep_schedule(timesteps: list[float], denoising_start: float, denoi
|
||||
t_start_idx = _find_last_index_ge_val(timesteps, t_start_val)
|
||||
t_end_idx = _find_last_index_ge_val(timesteps, t_end_val)
|
||||
|
||||
clipped_timesteps = timesteps[t_start_idx : t_end_idx + 1]
|
||||
# TODO(ryand): Make fractional cutoffs optional and apply to both the start and end.
|
||||
clipped_timesteps = timesteps[t_start_idx + 1 : t_end_idx + 1]
|
||||
clipped_timesteps = [t_start_val] + clipped_timesteps
|
||||
|
||||
return clipped_timesteps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user