Skip to content

fix(diffusers): pass text prompts by keyword - #11836

Closed
cananoo wants to merge 2 commits into
mudler:masterfrom
cananoo:fix/flux2-prompt-11833
Closed

cananoo wants to merge 2 commits into
mudler:masterfrom
cananoo:fix/flux2-prompt-11833

Conversation

@cananoo

@cananoo cananoo commented Sep 2, 2026

Copy link
Copy Markdown

Fixes #11833

Pass text-to-image prompts using the named prompt argument. FLUX.2 pipelines accept image as their first positional argument, so the previous call left prompt unset and failed generation.

Validation: python -m compileall -q backend.py test.py; ruff check backend.py test.py --select F821; git diff --check. The focused pytest cannot run in this Windows environment because torch and diffusers are not installed. The added regression test models the FLUX.2-compatible signature. AI assistance is attributed in the commit trailer.

@cananoo
cananoo force-pushed the fix/flux2-prompt-11833 branch from e6c3b12 to a8c431c Compare September 2, 2026 10:09
@cananoo

cananoo commented Sep 4, 2026 •

Copy link
Copy Markdown
Author

Thanks for the careful review. I pushed fa26adc to close the sibling positional-call gap: the img2vid path now passes image= and the txt2vid path passes prompt=. This keeps the argument names explicit across all three diffusers generation paths. python -m compileall -q backend/python/diffusers/backend.py backend/python/diffusers/test.py and ruff check ... --select F821 pass locally. The FLUX.2 signature premise remains unverified here, as noted.

@cananoo

cananoo commented Sep 4, 2026

Copy link
Copy Markdown
Author

The updated head fa26adc has a passing DCO check. The remaining repository workflows are currently action_required and did not execute, so a maintainer approval or rerun is needed before the change can be fully evaluated.

pengmin added 2 commits September 4, 2026 15:21
FLUX.2 pipelines accept image as their first positional argument, so passing a text prompt positionally leaves prompt unset and fails generation. Use the named prompt parameter and cover the FLUX.2-compatible signature with a focused regression test.

Assisted-by: Codex:gpt-5
Signed-off-by: pengmin <minpeng@semigraph.com>
Signed-off-by: pengmin <minpeng@semigraph.com>
@cananoo
cananoo force-pushed the fix/flux2-prompt-11833 branch from fa26adc to fc083a9 Compare September 4, 2026 07:21
@cananoo

cananoo commented Sep 4, 2026

Copy link
Copy Markdown
Author

Updated the PR branch onto the latest mudler/LocalAI master (1f2f931) as requested. The PR change remains unchanged; the new head is fc083a9. Local Python compilation, Ruff F821, and git diff check pass. DCO and the repository workflows should rerun; some workflows may still require maintainer approval.

mudler pushed a commit that referenced this pull request Sep 5, 2026
Squashed merge of #11836.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
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.

diffusers backend: FLUX.2 pipelines fail with "Provide either prompt or prompt_embeds" because the prompt is passed positionally

1 participant