Views
No views yet
Outpaint the image. to perform image outpainting.| Example 1 | Example 2 | Example 3 | |
|---|---|---|---|
| Prompt | Outpaint the image. | Outpaint the image. | Outpaint the image. |
| Input | ![]() | ![]() | ![]() |
| Outpainted Image | ![]() | ![]() | ![]() |
| Example 4 | Example 5 | Example 6 | |
|---|---|---|---|
| Prompt | Outpaint the image. A chicken-headed man in suspenders is playing basketball. | Outpaint the image. A man in suspenders is playing basketball. | Outpaint the image. A chicken-headed man in suspenders is playing basketball with a white background. |
| Input | ![]() | ![]() | ![]() |
| Outpainted Image | ![]() | ![]() | ![]() |
git clone https://github.com/modelscope/DiffSynth-Studio.git
cd DiffSynth-Studio
pip install -e .1import torch
2from diffsynth.pipelines.flux_image_new import FluxImagePipeline, ModelConfig
3from PIL import Image
4from modelscope import snapshot_download
5
6```python
7snapshot_download("DiffSynth-Studio/FLUX.1-Kontext-dev-lora-SuperOutpainting", cache_dir="./models")
8pipe = FluxImagePipeline.from_pretrained(
9 torch_dtype=torch.bfloat16,
10 device="cuda",
11 model_configs=[
12 ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="flux1-kontext-dev.safetensors"),
13 ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder/model.safetensors"),
14 ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder_2/"),
15 ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="ae.safetensors"),
16 ],
17)
18pipe.load_lora(pipe.dit, "models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-SuperOutpainting/model.safetensors", alpha=1)
19
20image = Image.open("your_image.jpg")
21image = pipe(
22 prompt="Outpaint the image.",
23 kontext_images=image,
24 embedded_guidance=2.5,
25 seed=0,
26)
27image.save("output.jpg")