From bc15dfeffa5a745416d7280ac298065f3ba1063d Mon Sep 17 00:00:00 2001 From: Aryan Date: Thu, 26 Jun 2025 22:08:04 +0000 Subject: [PATCH] fix --- docs/source/en/api/pipelines/flux.md | 4 ++-- src/diffusers/pipelines/flux/pipeline_flux_kontext.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/source/en/api/pipelines/flux.md b/docs/source/en/api/pipelines/flux.md index 1c41b85ca90a..ca39d718144b 100644 --- a/docs/source/en/api/pipelines/flux.md +++ b/docs/source/en/api/pipelines/flux.md @@ -302,11 +302,11 @@ image.save("flux-kontext.png") Flux Kontext comes with an integrity safety checker, which should be run after the image generation step. To run the safety checker, install the official repository from [black-forest-labs/flux](https://github.com/black-forest-labs/flux) and add the following code: ```python -from flux.safety import PixtralIntegrity +from flux.content_filters import PixtralContentFilter # ... pipeline invocation to generate images -integrity_checker = PixtralIntegrity(torch.device("cuda")) +integrity_checker = PixtralContentFilter(torch.device("cuda")) image_ = np.array(image) / 255.0 image_ = 2 * image_ - 1 image_ = torch.from_numpy(image_).to("cuda", dtype=torch.float32).unsqueeze(0).permute(0, 3, 1, 2) diff --git a/src/diffusers/pipelines/flux/pipeline_flux_kontext.py b/src/diffusers/pipelines/flux/pipeline_flux_kontext.py index 2427e342a9a0..e90aa6204acd 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_kontext.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_kontext.py @@ -65,8 +65,10 @@ ... ) >>> pipe.to("cuda") - >>> image = load_image("inputs/yarn-art-pikachu.png").convert("RGB") - >>> prompt = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/yarn-art-pikachu.png" + >>> image = load_image( + ... "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/yarn-art-pikachu.png" + ... ).convert("RGB") + >>> prompt = "Make Pikachu hold a sign that says 'Black Forest Labs is awesome', yarn art style, detailed, vibrant colors" >>> image = pipe( ... image=image, ... prompt=prompt,