Fractional denoise start.

This commit is contained in:
Ryan Dick
2024-09-24 14:52:24 +00:00
parent f6b801ec22
commit 0139788e65
2 changed files with 8 additions and 3 deletions

View File

@@ -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 (

View File

@@ -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