yujiepan's picture
Upload folder using huggingface_hub
a1d8638 verified
|
Raw History Blame Contribute Delete
3.87 kB
metadata
library_name: diffusers
base_model:
  - black-forest-labs/flux-3-image-klein-comfy

This is a randomly initialized tiny model based on black-forest-labs/flux-3-image-klein-comfy for testing and debugging.

Feature Source (BF16 component set) This repo
Checkpoint tensor elements 19.40B BF16, 84.05M F32, 1 I64 10.07M BF16, 1.09M F32, 2 I64
Safetensors weight files 39.13 GB (4 files) 24.61 MB (6 files)
Image transformer width / heads / head dimension 3072 / 24 / 128 128 / 4 / 32
Per-mode / joint blocks 5 / 28 2 / 2
Image / reference latent channels 128 / 128 Same
Text encoder layers / width / output taps 36 / 2560 / 8 8 / 8 / 8
Text condition width 20480 64
Prompt upsampler layers / width 32 / 4096 8 / 8; two attention cycles
Text encoder / upsampler vocabulary rows 151936 / 248320 Same
VAE stages / residual blocks / precision 4 / 2 / FP32 Same
VAE stage widths 128 / 256 / 512 / 512 32 / 32 / 32 / 32
Denoiser / text encoders precision BF16 Same
Inputs / output Text, up to 10 reference images, bounding boxes → image Same
File path Size
model.safetensors 4.4MB
prompt_upsampler/model.safetensors 8.4MB
text_encoder/model.safetensors 3.0MB
transformer/diffusion_pytorch_model.safetensors 4.4MB
vae/diffusion_pytorch_model.safetensors 2.2MB
vae/flux2-vae.safetensors 2.2MB

Example usage

SGLang (✅ verified)

Install the FLUX configuration plugin included in tiny-random/flux-3-image-klein-comfy. It reads text/VAE dimensions through official diffusion hooks; the installed SGLang files are unchanged. CUDA Graph warmup covers 64×64 text-to-image; reference-image signatures use SDPA outside captured graphs.

hf download tiny-random/flux-3-image-klein-comfy --local-dir ./flux-3-image-klein-comfy
python -m pip install --no-deps ./flux-3-image-klein-comfy/runtime
sglang serve \
  --model-path tiny-random/flux-3-image-klein-comfy \
  --model-type diffusion \
  --num-gpus 4 \
  --tp-size 4 \
  --ulysses-degree 1 \
  --ring-degree 1 \
  --attention-backend torch_sdpa \
  --enable-breakable-cuda-graph \
  --warmup-resolutions 64x64

Diffusers (✅ verified)

Use Diffusers from commit aaf57d03a3edfbd9de457d2872417a92f149a91d or a release containing FLUX 3. The repo includes the native Diffusers component layout for standard pretrained loading.

def run_diffusers(model_id: str):
    import torch
    from PIL import Image
    from diffusers import ModularPipeline

    pipe = ModularPipeline.from_pretrained(model_id)
    pipe.load_components(
        pretrained_model_name_or_path=model_id, dtype={"default": torch.bfloat16, "vae": torch.float32}
    )
    pipe.to("cuda")
    image = pipe(
        prompt="Combine these scenes into a red and green illustration.",
        image=[Image.new("RGB", (64, 64), "blue"), Image.new("RGB", (64, 64), "green")],
        height=64,
        width=64,
        num_inference_steps=2,
        max_new_tokens=10,
        text_encoder_out_layers=tuple(range(1, 9)),
        generator=torch.Generator(device="cuda").manual_seed(42),
        output="images",
    )[0]
    image.save("flux3-output.png")
    print(pipe.transformer)
    print(image.size)


if __name__ == "__main__":
    run_diffusers(model_id="tiny-random/flux-3-image-klein-comfy")

Creating this repo

Change log

  • 2026-10-26: Created a tiny BF16 FLUX 3 Image Klein with its text encoder, prompt upsampler and FP32 VAE.

This repo is generated by GPT-6.1-Sol.