tiny ramdom models
Collection
144 items β’ Updated β’ 10
How to use tiny-random/flux-3-image-klein-comfy with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("tiny-random/flux-3-image-klein-comfy", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]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 |
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
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")
This repo is generated by GPT-6.1-Sol.
Base model
black-forest-labs/flux-3-image-klein