Skip to content

convert AlignYourStepsScheduler node to V3 schema #9226

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bigcat88
Copy link
Contributor

@bigcat88 bigcat88 commented Aug 7, 2025

This node is widely used by the community in these three ways:

if scheduler.startswith('AYS'):
    sigmas = nodes.NODE_CLASS_MAPPINGS['AlignYourStepsScheduler']().get_sigmas(scheduler[4:], steps, denoise=1.0)[0]
else:
   sigmas = samplers.calculate_sigmas(model.get_model_object("model_sampling"), scheduler, steps)
from comfy_extras.nodes_align_your_steps import AlignYourStepsScheduler

model_type = scheduler.split(' ')[1]
sigmas = AlignYourStepsScheduler().get_sigmas(model_type, steps, denoise)[0]
sigmas = nodes_align_your_steps.AlignYourStepsScheduler.get_sigmas(self, model_type, steps, denoise)
sampler = comfy.samplers.sampler_object(sampler_name)

All of these variants were tested with this PR.

Why is get_sigmas not defined as follows in this PR:

def get_sigmas(self, model_type, steps, denoise):
        return self.execute(model_type, steps, denoise).result

This is because one of the community's usage variants will result in an AttributeError: 'AlignYourStepsSchedule' object has no attribute 'execute'. This error occurs because community nodes pass their own class as self, which is not the AlignYourStepsScheduler and does not have get_sigmas defined. The original AlignYourStepsScheduler.get_sigmas from the V1 schema does not use self, which is why it works for the community.


Question: Should we add a clear RuntimeWarning to get_sigmas, like this:

warnings.warn(
            "get_sigmas() is deprecated; please switch to the V3 schema and call .execute(...) directly",
            DeprecationWarning,
            stacklevel=2,
        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Core team dependency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants