Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@
title: Stable Diffusion
- local: api/pipelines/stable_unclip
title: Stable unCLIP
- local: api/pipelines/unipic3
title: UniPic-3
- local: api/pipelines/value_guided_sampling
title: Value-guided sampling
- local: api/pipelines/visualcloze
Expand Down
56 changes: 56 additions & 0 deletions docs/source/en/api/pipelines/unipic3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# UniPic-3

[UniPic-3](https://arxiv.org/abs/2601.15664) is a unified framework for **single-image editing** and **multi-image composition** by Skywork, built on the Qwen-Image-Edit architecture. It supports 1–6 input images with arbitrary output resolutions.

| Model | HuggingFace | Inference Steps |
|-------|-------------|-----------------|
| Base Model | [Skywork/Unipic3](https://huggingface.co/Skywork/Unipic3) | 50 steps |
| Consistency Model | [Skywork/Unipic3-Consistency-Model](https://huggingface.co/Skywork/Unipic3-Consistency-Model) | 8 steps |
| DMD Model | [Skywork/Unipic3-DMD](https://huggingface.co/Skywork/Unipic3-DMD) | 8 steps |

> [!TIP]
> Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers.md) to learn how to explore the tradeoff between scheduler speed and quality.

## Usage example

```python
import torch
from PIL import Image
from diffusers import UniPic3Pipeline
from diffusers.utils import load_image

pipe = UniPic3Pipeline.from_pretrained("Skywork/Unipic3", torch_dtype=torch.bfloat16)
pipe.to("cuda")

image1 = load_image("https://example.com/pig.png").convert("RGB")
image2 = load_image("https://example.com/sunglasses.png").convert("RGB")

image = pipe(
images=[image1, image2],
prompt="A pig wearing sunglasses.",
negative_prompt=" ",
num_inference_steps=50,
true_cfg_scale=4.0,
generator=torch.manual_seed(0),
).images[0]

image.save("unipic3_output.png")
```

## UniPic3Pipeline

[[autodoc]] UniPic3Pipeline
- all
- __call__
2 changes: 2 additions & 0 deletions src/diffusers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@
"UniDiffuserModel",
"UniDiffuserPipeline",
"UniDiffuserTextDecoder",
"UniPic3Pipeline",
"VersatileDiffusionDualGuidedPipeline",
"VersatileDiffusionImageVariationPipeline",
"VersatileDiffusionPipeline",
Expand Down Expand Up @@ -1667,6 +1668,7 @@
UniDiffuserModel,
UniDiffuserPipeline,
UniDiffuserTextDecoder,
UniPic3Pipeline,
VersatileDiffusionDualGuidedPipeline,
VersatileDiffusionImageVariationPipeline,
VersatileDiffusionPipeline,
Expand Down
2 changes: 2 additions & 0 deletions src/diffusers/pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
"QwenImageControlNetPipeline",
"QwenImageLayeredPipeline",
]
_import_structure["unipic3"] = ["UniPic3Pipeline"]
_import_structure["chronoedit"] = ["ChronoEditPipeline"]
_import_structure["glm_image"] = ["GlmImagePipeline"]

Expand Down Expand Up @@ -925,6 +926,7 @@
StableDiffusionAdapterPipeline,
StableDiffusionXLAdapterPipeline,
)
from .unipic3 import UniPic3Pipeline
from .visualcloze import VisualClozeGenerationPipeline, VisualClozePipeline
from .wan import (
WanAnimatePipeline,
Expand Down
48 changes: 48 additions & 0 deletions src/diffusers/pipelines/unipic3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from typing import TYPE_CHECKING

from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)


_dummy_objects = {}
_additional_imports = {}
_import_structure = {}

try:
if not (is_transformers_available() and is_torch_available()):
raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
from ...utils import dummy_torch_and_transformers_objects # noqa F403

_dummy_objects.update(get_objects_from_module(dummy_torch_and_transformers_objects))
else:
_import_structure["pipeline_unipic3"] = ["UniPic3Pipeline"]

if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
try:
if not (is_transformers_available() and is_torch_available()):
raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
from ...utils.dummy_torch_and_transformers_objects import * # noqa F403
else:
from .pipeline_unipic3 import UniPic3Pipeline
else:
import sys

sys.modules[__name__] = _LazyModule(
__name__,
globals()["__file__"],
_import_structure,
module_spec=__spec__,
)

for name, value in _dummy_objects.items():
setattr(sys.modules[__name__], name, value)
for name, value in _additional_imports.items():
setattr(sys.modules[__name__], name, value)
Loading
Loading