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

add support FluxFill inpainting pipeline #1095

Merged
merged 4 commits into from
Jan 8, 2025

Conversation

eaidova
Copy link
Collaborator

@eaidova eaidova commented Dec 26, 2024

What does this PR do?

Support export and inference for https://huggingface.co/black-forest-labs/FLUX.1-Fill-dev

import torch
from diffusers.utils import load_image

from optimum.intel.openvino import OVDiffusionPipeline

model_id = "black-forest-labs/FLUX.1-Fill-dev"


image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")

pipe = OVDiffusionPipeline.from_pretrained(model_id)
image = pipe(
    prompt="a white paper cup",
    image=image,
    mask_image=mask,
    height=512,
    width=512,
    guidance_scale=30,
    num_inference_steps=50,
    max_sequence_length=512,
    generator=torch.Generator("cpu").manual_seed(0),
).images[0]
image.save("flux-fill-dev.png")

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@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.

Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

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

LGTM!

@echarlaix
Copy link
Collaborator

also @eaidova would you mind adding a test for the CLI as well ? https://github.com/huggingface/optimum-intel/blob/main/tests/openvino/test_exporters_cli.py#L67C5-L67C28

@eaidova
Copy link
Collaborator Author

eaidova commented Jan 6, 2025

also @eaidova would you mind adding a test for the CLI as well ? https://github.com/huggingface/optimum-intel/blob/main/tests/openvino/test_exporters_cli.py#L67C5-L67C28

tests provided

@eaidova eaidova requested a review from echarlaix January 6, 2025 14:22
Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

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

LGTM!

@echarlaix echarlaix merged commit 58aec63 into huggingface:main Jan 8, 2025
22 checks passed
@eaidova eaidova deleted the ea/flux_fill branch January 8, 2025 13:13
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.

3 participants