翻篇收录说明
翻篇网页快照

FLUX 3 Image Klein - Black Forest Labs

https://docs.bfl.ai/flux_3/flux3_image_klein

最近抓取:2026-12-03 17:34:21(北京时间)

最近内容变化:2026-12-03 17:34:21(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Designed for image editing. Fast and customizable with open weights. Run FLUX 3 Image Klein through the API, on Hugging Face, or in ComfyUI.

正文摘录

FLUX 3 ImageKleinFLUX 3 Image Klein is a compact, open-weights version of FLUX 3 Image, designed for image editing. Write an edit instruction, generate an image from text, combine up to 10 references, or use bounding boxes to guide layouts. It runs faster and fits on consumer GPUs, down to an RTX 3090. Always run a prompt upsampler.SpecsFLUX 3 Image Klein comes in two variants. Distilled is step-distilled for fast inference. Base is the undistilled model for fine-tuning, LoRA training, and research.Klein (Distilled)Klein BaseParameters5.6B5.6BMax resolutionUp to 4KUp to 4KInference steps1650Guidance (CFG)13.5Bounding box supportYesYesBest forFast editing and generation, local deploymentFine-tuning, LoRA training, researchLicenseFLUX Kommunity LicenseFLUX Kommunity LicenseAvailabilityAPI, Hugging FaceHugging FacePricingPriced per image by output resolution. Text to image and image editing cost the same.ResolutionPrice per image768 × 7681K1.5K2K4KSee API pricing for all models.Ways to use itAlways run a prompt upsampler. The model is trained on the captions it writes; a prompt sent as typed gives noticeably weaker results. API Diffusers / Hugging Face ComfyUISend a request to the Klein endpoint, then poll the returned polling_url until status is Ready. The API runs the prompt upsampler automatically. The request takes the same fields as FLUX 3 Image, plus seed, steps, and output_format. By default, a Klein edit is the same size as the first reference, so Klein has no match_input. Its width and height start at 64 pixels.curl --request POST \ --url https://api.bfl.ai/v1/flux-3-image-klein \ --header "x-key: $BFL_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "prompt": "Make it a winter night: snow on the roof, the dock and the trees, the lake is frozen, warm yellow light glowing in the cabin windows.", "images": [ "https://cdn.sanity.io/images/2gpum2i6/production/ae68491f9136ce25fc5c8d91830a778d73340c10-1800x1350.webp" ] }' See the API reference for all parameters.Accept the model license on Hugging Face, then run the weights locally with Diffusers. The modular pipeline runs the prompt upsampler automatically. Pass your prompt; add image when editing an existing image.pip install git+https://github.com/huggingface/diffusers.git import torch from diffusers import ModularPipeline from diffusers.utils import load_image pipe = ModularPipeline.from_pretrained("black-forest-labs/flux-3-image-klein") pipe.load_components(dtype={"vae": torch.float32, "default": torch.bfloat16}) pipe.to("cuda") reference = load_image( "https://cdn.sanity.io/images/2gpum2i6/production/ae68491f9136ce25fc5c8d91830a778d73340c10-1800x1350.webp" ) result = pipe( prompt="Make it a winter night: snow on the roof, the dock and the trees, the lake is frozen, warm yellow light glowing in the cabin windows.", image=reference, generator=torch.Generator().manual_seed(0), output=["images", "prompt"], ) result["images"][0].save("klein-edit.png") print(result["prompt"]) # the caption the upsampler wrote The pipeline passes the same reference to the upsampler and the model. For text to image, omit image.For fine-tuning and LoRA training, use the Base weights (black-forest-labs/flux-3-image-klein-base).Run FLUX 3 Image Klein in ComfyUI with a ready-made workflow. Update ComfyUI to the latest version. Download the Klein weights from Hugging Face. Load the Klein workflow from the ComfyUI Klein page and enter your prompt. Prompt upsamplingKlein is trained on full scene captions. The prompt upsampler (black-forest-labs/flux-3-image-klein-pup) rewrites your prompt into that kind of caption before generation, using any reference images you provide. Reference code: the CLI runs it by default. Don’t pass --no-pup unless you write full captions yourself. Diffusers: the modular pipeline runs it on every request, text-to-image and editing, and passes the same reference images to the upsampler and the model. Keep it in the pipeline; it adds a 9B model, so account for it in GPU memory. API: the API runs it for you. Send your prompt, with reference images when editing. Advanced: supply a caption from your own upsampling stageIf your system already runs prompt upsampling separately, pass the resulting full scene caption to the image stage. For edits, that stage must use the same reference images as the upsampler. This separates the two stages; it does not replace upsampling with a short instruction.See the Diffusers prompt upsampling guide for separating the upsampler block from the image pipeline.Edit an imageWrite the change as an instruction. Drag the handle to compare each source with its edit:Text to imagePhotography, illustration, and typography from a single prompt. Click any image to view it full size.Train a LoRALoRA training lets you personalize Klein to your own brand guidelines, products, characters or visual styles. Train LoRAs on Klein Base. A rank-32 LoRA trained on a handful of images on a single GPU is enough to teach Klein a new style or edit. The trained LoRA can also run on Klein Distilled.For a full walkthrough, from dataset and captions to picking a checkpoint, see Train your first LoRA on FLUX 3 Image Klein.AI ToolkitTraining suite with a GUI and CLI. Supports both text-to-image and edit LoRAs.DiffusersHugging Face training scripts for DreamBooth and LoRA.Training configSettingValueBase modelKlein BaseDataset20 images, captions end with the trigger shtm styleResolution~1 MP, native aspect ratioLoRA rank / alpha32 / 32OptimizerAdamW, betas (0.9, 0.95)Learning rate1e-4, 200 warmup steps, then constantSteps4000, checkpoint every 250Hardware1 GPU, about 4.5 hoursThe same settings as an AI Toolkit config (select FLUX.3 Image Klein (base) in the UI, or arch: flux3):job: extension config: name: klein-miniature-lora process: - type: diffusion_trainer training_folder: output device: cuda:0 network: type: lora linear: 32 linear_alpha: 32 save: dtype: bf16 save_every: 250 datasets: - folder_path: data/miniature # images + .txt captions ending in "shtm style" caption_ext: txt resolution: [1024] train: batch_size: 1 steps: 4000 lr: 1e-4 lr_scheduler: constant_with_warmup lr_scheduler_params: num_warmup_steps: 200 optimizer: adamw optimizer_params: betas: [0.9, 0.95] dtype: bf16 model: name_or_path: black-forest-labs/flux-3-image-klein-base arch: flux3 Example: Persian miniature LoRAWe trained a style LoRA on 20 public-domain paintings from the 16th-century Shahnameh of Shah Tahmasp. Captions describe only the content and end with the trigger shtm style.Six of the 20 training images:Example caption:A crowned ruler in a green robe sits on a throne inside an ornate tiled palace hall, attended by courtiers and guards while musicians sit in the foreground. In a narrow panel at the right, grooms and soldiers stand among horses and decorated elephants in a flowering landscape. shtm styleBase vs. LoRA at step 1500, same prompt and seed.Run a LoRA on Klein DistilledKlein Base and Klein Distilled share the same architecture, so a LoRA trained on Base loads into Distilled without any conversion. Train on Base, then generate with Distilled at 16 steps instead of 50.Keep Distilled’s sampler settings and lower the LoRA scale slightly. In our tests 0.75 matched the Base + LoRA result most closely, and anything from 0.5 to 1.0 works.SettingValueSteps16Guidance (CFG)1LoRA scale0.75 (0.5 to 1.0)The style or edit comes through as strongly as on Base. Distilled renders the same seed differently, so expect small changes in details like a hair color or the phase of the moon, not in the style itself.Two style LoRAs trained on Base, run on Base at 50 steps and on Distilled at 16 steps. Same prompt and seed.Was this page helpful?YesNo