Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] LEdits++ refactoring #7318

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ def __call__(

org_prompt = ""

# TODO: Check LEdits++ inputs + verify that invert has been run properly
# 1. Check inputs. Raise error if not correct
self.check_inputs(
negative_prompt,
Expand Down Expand Up @@ -933,6 +934,7 @@ def __call__(

# 7. Denoising loop
num_warmup_steps = 0
# TODO: Refactor out SEGA/LEdits++ functionality
with self.progress_bar(total=len(timesteps)) as progress_bar:
for i, t in enumerate(timesteps):
# expand the latents if we are doing classifier free guidance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ def __call__(
if user_mask is not None:
user_mask = user_mask.to(self.device)

# TODO: Check inputs
# TODO: Check LEdits++ inputs + verify that invert has been run properly
# 1. Check inputs. Raise error if not correct
# self.check_inputs(
# callback_steps,
Expand Down Expand Up @@ -1115,6 +1115,7 @@ def __call__(
guidance_scale_tensor, embedding_dim=self.unet.config.time_cond_proj_dim
).to(device=device, dtype=latents.dtype)

# TODO: Refactor out SEGA/LEdits++ functionality
self._num_timesteps = len(timesteps)
with self.progress_bar(total=self._num_timesteps) as progress_bar:
for i, t in enumerate(timesteps):
Expand Down