Image-to-Image
Diffusers
Safetensors
Diffusion Single File
English
rift1_decoder
text-to-image
image-editing
decoder
Instructions to use Rift-ai/Rift.1-decoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Rift-ai/Rift.1-decoder with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Rift-ai/Rift.1-decoder", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Diffusion Single File
How to use Rift-ai/Rift.1-decoder with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,7 +9,6 @@ library_name: diffusers
|
|
| 9 |
tags:
|
| 10 |
- text-to-image
|
| 11 |
- image-editing
|
| 12 |
-
- flux
|
| 13 |
- diffusion-single-file
|
| 14 |
- vae
|
| 15 |
- decoder
|
|
@@ -19,15 +18,15 @@ tags:
|
|
| 19 |
|
| 20 |

|
| 21 |
|
| 22 |
-
`Rift.1-decoder` is a
|
| 23 |
|
| 24 |
The exported Diffusers runtime class remains `AutoencoderKLFlux2` for loader compatibility. The model metadata identifies the architecture as `Rift1Decoder` with model type `rift1_decoder`.
|
| 25 |
|
| 26 |
# **Key Features**
|
| 27 |
|
| 28 |
-
1. **
|
| 29 |
2. **Rift1Decoder metadata** in `config.json` for clear model identity.
|
| 30 |
-
3. **32 latent channels** for
|
| 31 |
4. **512px reconstruction training** with edge and frequency losses for sharper detail retention.
|
| 32 |
5. **Single-file artifacts included** for decoder-focused workflows:
|
| 33 |
- `diffusion_pytorch_model.safetensors`
|
|
@@ -37,11 +36,7 @@ The exported Diffusers runtime class remains `AutoencoderKLFlux2` for loader com
|
|
| 37 |
|
| 38 |
Compatible target pipeline family:
|
| 39 |
|
| 40 |
-
-
|
| 41 |
-
- [FLUX.2-klein-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-4B)
|
| 42 |
-
- [FLUX.2-klein-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-9B)
|
| 43 |
-
- [FLUX.2-klein-9b-kv](https://huggingface.co/black-forest-labs/FLUX.2-klein-9b-kv)
|
| 44 |
-
- [FLUX.2-dev](https://huggingface.co/black-forest-labs/FLUX.2-dev)
|
| 45 |
|
| 46 |
# **Comparison**
|
| 47 |
|
|
@@ -69,33 +64,21 @@ vae = AutoencoderKLFlux2.from_pretrained(
|
|
| 69 |
)
|
| 70 |
```
|
| 71 |
|
| 72 |
-
If using a compatible
|
| 73 |
|
| 74 |
```python
|
| 75 |
import torch
|
| 76 |
-
from diffusers import
|
| 77 |
|
| 78 |
device = "cuda"
|
| 79 |
dtype = torch.bfloat16
|
| 80 |
|
| 81 |
-
vae = AutoencoderKLFlux2.from_pretrained(
|
| 82 |
-
|
| 83 |
-
"black-forest-labs/FLUX.2-klein-4B",
|
| 84 |
-
vae=vae,
|
| 85 |
torch_dtype=dtype,
|
| 86 |
-
)
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
prompt = "A black cat holding a sign that says 'hello world' in typewriter font"
|
| 90 |
-
image = pipe(
|
| 91 |
-
prompt=prompt,
|
| 92 |
-
height=1024,
|
| 93 |
-
width=1024,
|
| 94 |
-
guidance_scale=1.0,
|
| 95 |
-
num_inference_steps=4,
|
| 96 |
-
generator=torch.Generator(device=device).manual_seed(0),
|
| 97 |
-
).images[0]
|
| 98 |
-
image.save("rift-decoder-output.png")
|
| 99 |
```
|
| 100 |
|
| 101 |
---
|
|
|
|
| 9 |
tags:
|
| 10 |
- text-to-image
|
| 11 |
- image-editing
|
|
|
|
| 12 |
- diffusion-single-file
|
| 13 |
- vae
|
| 14 |
- decoder
|
|
|
|
| 18 |
|
| 19 |

|
| 20 |
|
| 21 |
+
`Rift.1-decoder` is a VAE decoder made for the Rift model line. It is designed as a **drop-in decoder component** for compatible Diffusers image pipelines that use `AutoencoderKLFlux2`. The decoder has been trained as the Rift image reconstruction component.
|
| 22 |
|
| 23 |
The exported Diffusers runtime class remains `AutoencoderKLFlux2` for loader compatibility. The model metadata identifies the architecture as `Rift1Decoder` with model type `rift1_decoder`.
|
| 24 |
|
| 25 |
# **Key Features**
|
| 26 |
|
| 27 |
+
1. **Diffusers decoder interface** using `AutoencoderKLFlux2`.
|
| 28 |
2. **Rift1Decoder metadata** in `config.json` for clear model identity.
|
| 29 |
+
3. **32 latent channels** for compatible image latent spaces.
|
| 30 |
4. **512px reconstruction training** with edge and frequency losses for sharper detail retention.
|
| 31 |
5. **Single-file artifacts included** for decoder-focused workflows:
|
| 32 |
- `diffusion_pytorch_model.safetensors`
|
|
|
|
| 36 |
|
| 37 |
Compatible target pipeline family:
|
| 38 |
|
| 39 |
+
- Diffusers image pipelines using `AutoencoderKLFlux2`
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
# **Comparison**
|
| 42 |
|
|
|
|
| 64 |
)
|
| 65 |
```
|
| 66 |
|
| 67 |
+
If using a compatible image pipeline, pass this VAE when loading the pipeline:
|
| 68 |
|
| 69 |
```python
|
| 70 |
import torch
|
| 71 |
+
from diffusers import AutoencoderKLFlux2
|
| 72 |
|
| 73 |
device = "cuda"
|
| 74 |
dtype = torch.bfloat16
|
| 75 |
|
| 76 |
+
vae = AutoencoderKLFlux2.from_pretrained(
|
| 77 |
+
"Rift-ai/Rift.1-decoder",
|
|
|
|
|
|
|
| 78 |
torch_dtype=dtype,
|
| 79 |
+
).to(device)
|
| 80 |
+
|
| 81 |
+
# Pass `vae=vae` into a compatible Diffusers image pipeline.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
```
|
| 83 |
|
| 84 |
---
|