CoolFace
Apppublic

Xurxowsky/flux2-klein-4b-playground

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

FLUX.2 klein 4B Playground

This Hugging Face Space runs black-forest-labs/FLUX.2-klein-4B with a Gradio UI for:

  • —Text to image
  • —Image to image

Notes

  • —The model is loaded with torch.bfloat16 when the available GPU supports BF16.
  • —If BF16 is not available, the app falls back to torch.float16 on GPU and torch.float32 on CPU.
  • —On Spaces or larger GPUs, the app uses pipe.to("cuda").
  • —On smaller or mixed environments, the app uses pipe.enable_model_cpu_offload().
  • —The official Flux2KleinPipeline supports image conditioning directly. Because it does not document a dedicated strength argument, this Space implements the 0.0 to 1.0 intensity slider as a blend between the source image and the edited result.

ZeroGPU

To use ZeroGPU:

  1. 1.Create the Space with the Gradio SDK.
  2. 2.Upload these files.
  3. 3.In the Space hardware settings, select ZeroGPU.

The README metadata cannot force ZeroGPU directly. ZeroGPU is chosen in the Space settings, while @spaces.GPU makes the app compatible with it.