-
Notifications
You must be signed in to change notification settings - Fork 6k
Separate Sigma Schedule #10146
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
Separate Sigma Schedule #10146
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
e4daabb
to
8703cdc
Compare
from ..sigmas.exponential_sigmas import ExponentialSigmas | ||
from ..sigmas.karras_sigmas import KarrasSigmas | ||
|
||
class FlowMatchSD3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any reason, the flow match sigmas are treated differently from beta/exponential/karras? they all generate a sigma schedule, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beta/exponential/karras are more like a conversion of existing sigma schedule, the original functions are actually called _convert_to_*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlowMatchEuler currently has what we're calling FlowMatchSD3 here by default, and for other models we pass in sigmas, I think the one for SANA is different again, so it seems these will tend to be model specific, compared to everything in BetaSchedule
like timestep_spacing == "linspace"
interpolation_type == "linear"
which is shared and we rarely pass in sigmas, the exception is Align Your Steps schedules which I don't think is used often. We could inline these like timestep_spacing == "linspace"
in BetaSchedule
but like this the idea is that we can pass a custom class that just needs a call to return the sigmas if we wanted to in addition to the ones that are built-in, new models, custom schedules and experimentation can be supported easier. We could refactor BetaSchedule
in a similar way like LinspaceLinear
etc and allow the same level of experimentation, it just seems less likely to be used and the experimentation with this kind of scheduler will be done with conversion, there are a few more less popular from the community that we don't support but again the idea is that it can be passed in as a custom class.
I've added some notes, sana's schedule and combined |
@@ -245,6 +245,34 @@ def from_config(cls, config: Union[FrozenDict, Dict[str, Any]] = None, return_un | |||
deprecate("config-passed-as-path", "1.0.0", deprecation_message, standard_warn=False) | |||
config, kwargs = cls.load_config(pretrained_model_name_or_path=config, return_unused_kwargs=True, **kwargs) | |||
|
|||
# Handle old scheduler configs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be robust and probably kept for a while unless we can find a way to mass update configs on the Hub. It's working with some scheduler configs already, FlowMatch vs Beta is detected with shift
and beta_schedule
, I've already found an edge case in SANA's config because we integrated those scheduler changes into DPM so it has beta_schedule
and no shift
(it was called flow_shift
instead).
Hi @ukaprch. Thanks for your interest in Flow Match scheduling support. We know this is highly anticipated and we appreciate your patience while we work on it 🤗 |
I think the idea is to separate the current scheduler already accept this API here it is still part of the scheduler, just make it more configurable I think
the ideal design should not require much change to current scheduler class IMO |
That is what I was looking at initially, while you've been working on Modular I've added a further experimental design. We can make
These can be used if we add a ConfigMixin etc. Afaik some scheduler configs do specify We could also do the same for Flow Match base schedules, add a ConfigMixin etc., the class computes sigmas that are passed into scheduler instead of just code in the pipelines like now. diffusers/src/diffusers/schedulers/schedules/flow_schedule.py Lines 44 to 46 in 3b47229
|
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
What does this PR do?
This is not a finalised design, just a demonstration of how sigma/noise schedule can be moved out of schedulers, comments and feedback are encouraged.
Usage:
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
cc @yiyixuxu