chore:ruff

This commit is contained in:
dunkeroni
2025-05-22 20:36:03 -04:00
committed by psychedelicious
parent 2a92e7b920
commit 530cd180c5

View File

@@ -30,11 +30,13 @@ class RectifiedFlowInpaintExtension:
def _apply_mask_gradient_adjustment(self, t_prev: float) -> torch.Tensor:
"""Applies inpaint mask gradient adjustment and returns the inpaint mask to be used at the current timestep."""
# As we progress through the denoising process, we promote gradient regions of the mask to have a full weight of
# 1.0. This helps to produce more coherent seams around the inpainted region.
# 1.0. This helps to produce more coherent seams around the inpainted region.
# We use a small epsilon to avoid any potential issues with floating point precision.
eps = 1e-4
mask = torch.where(self._inpaint_mask >= t_prev + eps, 1.0, 0.0).to(dtype=self._inpaint_mask.dtype, device=self._inpaint_mask.device)
mask = torch.where(self._inpaint_mask >= t_prev + eps, 1.0, 0.0).to(
dtype=self._inpaint_mask.dtype, device=self._inpaint_mask.device
)
return mask