8000 Add node to extend sigmas by catboxanon · Pull Request #7901 · comfyanonymous/ComfyUI · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add node to extend sigmas #7901

< 8000 div class="gh-header-actions mt-0 mb-3 mb-md-2 ml-1 flex-md-order-1 flex-shrink-0 d-flex flex-items-center gap-1">
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

Merged
merged 4 commits into from
May 2, 2025

Conversation

catboxanon
Copy link
Contributor
@catboxanon catboxanon commented May 1, 2025

This PR adds a node that will extend the sigma values for a given sigma range. This is exactly identical functionality to #7890 but now applicable to any sampler -- see that PR for more details.

@liesened
Copy link
Contributor
liesened commented May 1, 2025

Personally I don't agree on the naming, it's sort of out of place. I'd suggest renaming a bunch of things:

  • expand -> extend
  • ExpandSigmas -> ExtendIntermediateSigmas
  • sigma_max -> start_at_sigma
  • sigma_min -> end_at_sigma
  • expanded_sigmas -> extended_sigmas

Also, I'd like to detach the interpolation space from the actual interpolation function, and introduce spacing input. This will make interpolating between steps using different functions easier to implement.

...

interpolator = {
    'linear': lambda x: x
    'cosine': lambda x: torch.sin(x*math.pi/2)
    'sine':   lambda x: 1 - torch.cos(x*math.pi/2)
}[spacing]

# linear space for our interpolation function
x = torch.linspace(0, 1, steps + 1)[1:-1]

for i in range(len(sigmas) - 1):

    ...

    if start_at_sigma <= sigma_current <= end_at_sigma:
        interpolated_steps = interpolator(x) * (sigma_next - sigma_current) + sigma_current
        extended_sigmas.extend(interpolated_steps.tolist())

...

Co-authored-by: liesen <liesen.dev@gmail.com>
@catboxanon catboxanon changed the title Add ExpandSigmas node Add node to extend sigmas May 1, 2025
@comfyanonymous comfyanonymous merged commit 551fe8d into comfyanonymous:master May 2, 2025
5 checks passed
@catboxanon catboxanon deleted the feat/expand-sigmas branch May 2, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0