Skip to content

[OpenVINO]Add Kontext support #1374

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 9 commits into
base: main
Choose a base branch
from

Conversation

openvino-dev-samples
Copy link
Contributor

Depends on this PR for Diffusers

@openvino-dev-samples
Copy link
Contributor Author

@nikita-savelyevv could help to review ?

@nikita-savelyevv
Copy link
Collaborator

@bot /style

Copy link

github-actions bot commented Jul 7, 2025

Style bot fixed some files and pushed the changes.

@HuggingFaceDocBuilderDev

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.

@@ -76,6 +76,7 @@
"flaubert": "hf-internal-testing/tiny-random-flaubert",
"flux": "katuni4ka/tiny-random-flux",
"flux-fill": "katuni4ka/tiny-random-flux-fill",
"flux-kontext": "snake7gun/flux-kontext-random",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe adding this here is not enough for the test for this model to be run. Could you please add changes to test_diffusion.py, test_exporters_cli.py and test_quantization.py similar to how it was done in this PR for example #1106?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @IlyasMoutawwakil my patch depends on the fix for diffusers lib, could you help to check ?
huggingface/diffusers#11875

Copy link
Member

@IlyasMoutawwakil IlyasMoutawwakil Jul 8, 2025

Choose a reason for hiding this comment

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

you don't need to wait for diffusers to do an entire release to test this. You can do the same as sana by using DiffusionPipeline instead of AutoPipelineForxxx https://github.com/huggingface/optimum-intel/blob/main/tests/openvino/test_diffusion.py#L146 for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you don't need to wait for diffusers to do an entire release to test this. You can do the same as sana by using DiffusionPipeline instead of AutoPipelineForxxx https://github.com/huggingface/optimum-intel/blob/main/tests/openvino/test_diffusion.py#L146 for now

yes, but how about in CLI export test case ?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@openvino-dev-samples openvino-dev-samples Jul 10, 2025

Choose a reason for hiding this comment

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

cli export test should pass as it uses the correct class name https://github.com/huggingface/optimum/blob/ec756fdd00543d3a93458fafbcdf5abbb17b61ba/optimum/exporters/tasks.py#L2159 🙂

  1. CLI export should not work without my patch on diffusers
  2. another question is if there is a method to update the version of diffusers in pytest?
    E ImportError: cannot import name 'FluxKontextPipeline' from 'diffusers'

Copy link
Member

Choose a reason for hiding this comment

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

  1. no it should work without it. your patch is only rleevant to the AutoPipelineForxxx class, not the DiffusionPipeline class.
  2. update it to what version ? I just checked the latest diffusers and this model is not even released in diffusers yet https://github.com/huggingface/diffusers/blob/v0.34.0/src/diffusers/pipelines/flux/pipeline_flux_kontext.py
    what's exactly the motive for adding this model anyway ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So your suggestion is adding the model after 0.34.0 version of diffuser released, am i right ?

Copy link
Member

Choose a reason for hiding this comment

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

or install diffusers from source.. for testing sake.
but bear in mind that python packages can't be released with a "git+https...." dependency, so we will have to wait for a diffusers release if you want this in the next optimum-intel release.

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.

4 participants