FLUX.2 [klein] 4B (Sentis, float16)

This is an unofficial conversion of FLUX.2 [klein] 4B by Black Forest Labs, for Unity Inference Engine and the Unity package tools.doji.diffusers. The model files are modified versions of the original weights: they are converted to Inference Engine's .sentis format, with float16 weights. The original Apache License 2.0 terms apply. See LICENSE.md.

The .sentis files take 13.1 GiB.

Other versions:

How the files were made

The source is the ONNX export in julienkay/FLUX.2-klein-4B-onnx. Its card describes the export and the inputs and outputs of each part.

Each part was converted with tools.doji.onnx-model-loader as OnnxModelLoader.Save(onnxPath, sentisPath, QuantizationType.Float16). It writes the weights from the ONNX file to the .sentis file one at a time, so it never holds all the weights in memory.

  • The weights of rank 2 or more that MatMul, Gemm, Conv, ConvTranspose and Gather layers read are float16. All other weights, such as biases and norm weights, stay float32.
  • Weights stay float16 on the device. Each one is cast to float32 right before the layer that first reads it, so float32 copies exist only for the layers that are running.

The files were saved with Inference Engine 2.6. A later Inference Engine version may need them converted again from the ONNX files.

Example output

Made in Unity with Flux2KleinPipeline from these files. Prompt: "A photo of a red fox sitting in a snowy forest, golden hour". Settings: 4 steps, guidance scale 1, 512 ร— 512, initial latents torch.randn((1, 128, 32, 32), generator=torch.Generator("cpu").manual_seed(42)).

Red fox in a snowy forest generated in Unity

Usage

Add julienkay/FLUX.2-klein-4B-sentis-float16 to the project in Window > AI Model Hub, then:

using Doji.AI.Diffusers;

using var pipeline = await Flux2KleinPipeline.FromPretrainedAsync("julienkay/FLUX.2-klein-4B-sentis-float16");
var image = await pipeline.GenerateAsync("A photo of a red fox sitting in a snowy forest, golden hour",
    width: 512, height: 512, numInferenceSteps: 4, guidanceScale: 1f, seed: 42);
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for julienkay/FLUX.2-klein-4B-sentis-float16

Finetuned
(101)
this model

Collection including julienkay/FLUX.2-klein-4B-sentis-float16