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

Fix FLUX scheduler #2896

Closed
wants to merge 2 commits into from
Closed

Conversation

shuaiqidezhong
Copy link
Contributor

@shuaiqidezhong shuaiqidezhong commented Feb 20, 2025

Fixes #2832 .

@XprobeBot XprobeBot added this to the v1.x milestone Feb 20, 2025
@@ -416,8 +416,12 @@ def _get_scheduler(model: Any, sampler_name: str):
@contextlib.contextmanager
def _reset_when_done(model: Any, sampler_name: str):
assert model is not None
name_or_path: Optional[str] = getattr(model, "_name_or_path", None)
is_flux_sampler = "flux" in name_or_path.casefold() if name_or_path else False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd better judge flux by model_spec, so we may set this method to normal function instead of static method. Because we cannot ensure that the model path contains flux.

scheduler = DiffusionModel._get_scheduler(model, sampler_name)
if scheduler:
# When the model is not flux
should_swap_scheduler = scheduler is not None and not is_flux_sampler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to name a better one, maybe ignore_setting_scheduler.

@shuaiqidezhong shuaiqidezhong deleted the fix-flux branch February 20, 2025 06:51
@shuaiqidezhong shuaiqidezhong restored the fix-flux branch February 20, 2025 06: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.

通过xinference部署的FLUX.1-dev量化版本Q4_k_s 在dify内调用失败
3 participants