Downloads · 30 days
214
10% of all-time downloads
aifeifei798/FLUX.2-klein-9B-text_encoder-8bit
FLUX.2-klein-9B-text_encoder-8bit is a image-to-image model from aifeifei798. Use it when you need one image transformed into another. It is set up for diffusion-single-file. The card lists the license as other.
Downloads · 30 days
214
10% of all-time downloads
All-time downloads
2.1K
Public
Parameters
8.2B
9.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors9.4 GB · 100%
How the weights are stored.
I86.9B · 85%
From the Hugging Face model README
transformers >= 5.0.0
pip install git+https://github.com/huggingface/transformers.git
import torch
from transformers import (
BitsAndBytesConfig as BitsAndBytesConfig,
Qwen3ForCausalLM,
)
from diffusers import Flux2KleinPipeline
dtype = torch.float16
device = "cuda"
text_encoder_8bit = Qwen3ForCausalLM.from_pretrained(
"aifeifei798/FLUX.2-klein-9B-text_encoder-8bit",
torch_dtype=dtype,
)
pipe = Flux2KleinPipeline.from_pretrained(
"black-forest-labs/FLUX.2-klein-9B",
text_encoder=text_encoder_8bit,
torch_dtype=dtype,
)
#pipe.to("cuda") # GPU < 32G
pipe.enable_model_cpu_offload() # save some VRAM by offloading the model to CPU,GPU < 32G
prompt = "A cat holding a sign that says hello world"
image = pipe(
prompt,
height=1024,
width=1024,
guidance_scale=1.0,
num_inference_steps=4,
generator=torch.Generator(device=device).manual_seed(0),
).images[0]
image.save("flux-klein.png")