|
| 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