Skip to content

Commit 816fabd

Browse files
committed
Add SeFi-Image pipeline
1 parent ea80295 commit 816fabd

17 files changed

Lines changed: 1745 additions & 0 deletions

File tree

docs/source/en/_toctree.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@
389389
title: SanaVideoTransformer3DModel
390390
- local: api/models/sd3_transformer2d
391391
title: SD3Transformer2DModel
392+
- local: api/models/sefi_transformer2d
393+
title: SeFiTransformer2DModel
392394
- local: api/models/skyreels_v2_transformer_3d
393395
title: SkyReelsV2Transformer3DModel
394396
- local: api/models/stable_audio_transformer
@@ -605,6 +607,8 @@
605607
title: Sana Sprint
606608
- local: api/pipelines/sana_video
607609
title: Sana Video
610+
- local: api/pipelines/sefi
611+
title: SeFi-Image
608612
- local: api/pipelines/shap_e
609613
title: Shap-E
610614
- local: api/pipelines/stable_cascade
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--Copyright 2026 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
-->
12+
13+
# SeFiTransformer2DModel
14+
15+
[`SeFiTransformer2DModel`] is the SeFi-Image transformer. It uses a Flux2-style backbone with a dual timestep embedding
16+
for semantic and texture latent streams.
17+
18+
## SeFiTransformer2DModel
19+
20+
[[autodoc]] SeFiTransformer2DModel
21+
- forward
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!--Copyright 2026 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
-->
12+
13+
# SeFi-Image
14+
15+
[SeFi-Image](https://github.com/jmliu206/SeFi-Image) is a text-to-image model family based on Semantic-First Diffusion.
16+
It denoises a semantic latent stream slightly ahead of a texture latent stream, then decodes the final texture latents
17+
to images.
18+
19+
The public checkpoints on the Hub are gated and distributed under a non-commercial license. Accept the checkpoint
20+
license on the Hub before downloading them. Original SeFi-Image artifacts can be converted with
21+
`scripts/convert_sefi_to_diffusers.py` before loading them with [`SeFiPipeline`].
22+
23+
```python
24+
import torch
25+
from diffusers import SeFiPipeline
26+
27+
pipe = SeFiPipeline.from_pretrained("./sefi-1b-base-diffusers", torch_dtype=torch.bfloat16)
28+
pipe.to("cuda")
29+
30+
image = pipe("A red apple on a wooden table.").images[0]
31+
image.save("sefi.png")
32+
```
33+
34+
Convert the original artifacts first:
35+
36+
```bash
37+
python scripts/convert_sefi_to_diffusers.py \
38+
--checkpoint SeFi-Image/SeFi-Image-1B-Base \
39+
--output ./sefi-1b-base-diffusers \
40+
--token $HF_TOKEN
41+
```
42+
43+
Turbo checkpoints are distilled and support 4, 8, or 10 inference steps with `guidance_scale=1.0`.
44+
45+
## SeFiPipeline
46+
47+
[[autodoc]] SeFiPipeline
48+
- all
49+
50+
## SeFiPipelineOutput
51+
52+
[[autodoc]] pipelines.sefi.pipeline_output.SeFiPipelineOutput

0 commit comments

Comments
 (0)