Skip to content

Commit cc4f9ab

Browse files
committed
update docs
1 parent 36159dd commit cc4f9ab

File tree

1 file changed

+26
-0
lines changed
  • docs/source/en/api/pipelines

1 file changed

+26
-0
lines changed

docs/source/en/api/pipelines/flux.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Flux comes in the following variants:
3939
| Canny Control (LoRA) | [`black-forest-labs/FLUX.1-Canny-dev-lora`](https://huggingface.co/black-forest-labs/FLUX.1-Canny-dev-lora) |
4040
| Depth Control (LoRA) | [`black-forest-labs/FLUX.1-Depth-dev-lora`](https://huggingface.co/black-forest-labs/FLUX.1-Depth-dev-lora) |
4141
| Redux (Adapter) | [`black-forest-labs/FLUX.1-Redux-dev`](https://huggingface.co/black-forest-labs/FLUX.1-Redux-dev) |
42+
| Kontext | [`black-forest-labs/FLUX.1-Kontext`](https://huggingface.co/black-forest-labs/FLUX.1-Kontext) |
4243

4344
All checkpoints have different usage which we detail below.
4445

@@ -273,6 +274,31 @@ images = pipe(
273274
images[0].save("flux-redux.png")
274275
```
275276

277+
### Kontext
278+
279+
Flux Kontext is a model that allows in-context control of the image generation process, allowing for editing, refinement, relighting, style transfer, character customization, and more.
280+
281+
```python
282+
import torch
283+
from diffusers import FluxKontextPipeline
284+
from diffusers.utils import load_image
285+
286+
pipe = FluxKontextPipeline.from_pretrained(
287+
"black-forest-labs/FLUX.1-kontext", transformer=transformer, torch_dtype=torch.bfloat16
288+
)
289+
pipe.to("cuda")
290+
291+
image = load_image("inputs/yarn-art-pikachu.png").convert("RGB")
292+
prompt = "Make Pikachu hold a sign that says 'Black Forest Labs is awesome', yarn art style, detailed, vibrant colors"
293+
image = pipe(
294+
image=image,
295+
prompt=prompt,
296+
guidance_scale=2.5,
297+
generator=torch.Generator().manual_seed(42),
298+
).images[0]
299+
image.save("flux-kontext.png")
300+
```
301+
276302
## Combining Flux Turbo LoRAs with Flux Control, Fill, and Redux
277303

278304
We can combine Flux Turbo LoRAs with Flux Control and other pipelines like Fill and Redux to enable few-steps' inference. The example below shows how to do that for Flux Control LoRA for depth and turbo LoRA from [`ByteDance/Hyper-SD`](https://hf.co/ByteDance/Hyper-SD).

0 commit comments

Comments
 (0)