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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

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.

2 participants