Image

FLUX.2-klein 4B GGUF

Text-to-image and image editing on one desktop GPU (GGUF).

FLUX.2-klein 4B GGUF — Image Generation and Editing

FreeOnlineUnlimitedFLUX.2 klein by Black Forest Labs API access

API reference

Submit via REST

Use your personal API key (msk_…) to create jobs for this workload from your own tools. Jobs started this way run on the same devices you connected on Your Devices — at least one has to be online.

Hide API details
POSThttps://cp.meshlabs.cloud/v1/organizations/jobs

Authenticate with X-Organization-Api-Key: msk_your_personal_api_key. The header name matches org keys; personal keys use the same endpoint.

Input files:Call POST https://cp.meshlabs.cloud/v1/organizations/job-inputs/presign with the same API key, upload your file to the returned upload_url, then pass download_url in job_spec (for example as input_image_url).

Request body

{
  "workload_type": "flux2-klein-4b-gguf",
  "job_spec": {
    "prompt": "A photorealistic lighthouse at dusk",
    "width": 1024,
    "height": 1024,
    "edit_mode": "reference",
    "strength": 0.75,
    "steps": 4,
    "guidance": 1
  }
}

job_spec fields

FieldRequiredDefaultDescription
promptYes—What to generate — or, when you supply an image, the change you want made to it.
input_image_urlNo—Optional image to edit. The model conditions on it as a reference and your prompt describes the edit.
widthNo1024Output width in pixels.
heightNo1024Output height in pixels.
seedNo—Random seed. The same seed and prompt give the same image.
edit_modeNoreference'reference' is what FLUX.2-klein was trained for: the image conditions the model and the result is a new image following your instruction. 'init_image' instead starts from your image as noisy latents and repaints it by 'strength'. Only used with an input image.
strengthNo0.75How much of the input image to repaint: 0.3 is a light touch-up, 1.0 ignores it entirely. Only used with edit_mode 'init_image'.
negative_promptNo—What to avoid. Has little effect at guidance 1.0, which is what this distilled model runs at.
stepsNo4Denoising steps. FLUX.2-klein is distilled for 4; raising it costs time without improving the image.
guidanceNo1Classifier-free guidance scale. The distilled model is trained for 1.0 (no guidance pass).

cURL

curl -X POST https://cp.meshlabs.cloud/v1/organizations/jobs \
  -H "X-Organization-Api-Key: msk_your_personal_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "workload_type": "flux2-klein-4b-gguf",
  "job_spec": {
    "prompt": "A photorealistic lighthouse at dusk",
    "width": 1024,
    "height": 1024,
    "edit_mode": "reference",
    "strength": 0.75,
    "steps": 4,
    "guidance": 1
  }
}'
GEThttps://cp.meshlabs.cloud/v1/organizations/jobs/{job_id}

Poll with the same API key until status is terminal (COMPLETED, FAILED, CANCELED, or MODERATION_BLOCKED). When content moderation is enabled, jobs may start in MODERATION_PENDING before entering the compute queue. Completed jobs include presigned download_url values on each output.

Create response

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "workload_type": "flux2-klein-4b-gguf",
  "status": "PENDING",
  "job_spec_json": {
    "prompt": "A photorealistic lighthouse at dusk",
    "width": 1024,
    "height": 1024,
    "edit_mode": "reference",
    "strength": 0.75,
    "steps": 4,
    "guidance": 1
  },
  "work_units": [],
  "outputs": [],
  "created_at": "2026-06-08T12:00:00Z",
  "updated_at": "2026-06-08T12:00:00Z"
}

Completed response

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "workload_type": "flux2-klein-4b-gguf",
  "status": "COMPLETED",
  "job_spec_json": {
    "prompt": "A photorealistic lighthouse at dusk",
    "width": 1024,
    "height": 1024,
    "edit_mode": "reference",
    "strength": 0.75,
    "steps": 4,
    "guidance": 1
  },
  "work_units": [
    {
      "id": "…",
      "index": 0,
      "status": "COMPLETED"
    }
  ],
  "outputs": [
    {
      "id": "…",
      "output_type": "<output type>",
      "filename": "<output filename>",
      "size_bytes": 524288,
      "download_url": "<presigned output download URL>"
    }
  ],
  "created_at": "2026-06-08T12:00:00Z",
  "updated_at": "<completion timestamp>"
}

FLUX.2-klein is a distilled 4-billion-parameter image model: it produces a finished image in four denoising steps instead of the twenty or more most models need. This workload runs it in GGUF form through stable-diffusion.cpp, which keeps the text encoder, the transformer and the image decoder together on one machine — so a single desktop node with a capable graphics card completes the whole job with no peers involved. Supply an image to edit it: the image is used as a reference the model conditions on, and your prompt describes the change you want. Output is a PNG at up to 1024x1024.