计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
flux-pipelines【效率与协作】Operate Nunchaku FLUX and FLUX v2 Diffusers replacement workflows for text-to-image, Kontext editing, and FLUX.1 tools.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this operating sub-skill when a task asks to replace a Diffusers FLUX transformer with Nunchaku quantized FLUX weights, including basic FLUX.1-dev, FLUX.1-schnell, FLUX.1-krea-dev, FLUX.1-Kontext-dev, and FLUX.1 Tools-style Canny/Depth/Fill/Redux/ControlNet routes.
diffusers.FluxPipeline.diffusers.FluxKontextPipeline with an input image=.diffusers.FluxControlPipeline with control_image=.diffusers.FluxFillPipeline with image= and mask_image=.diffusers.FluxPriorReduxPipeline first, then a FluxPipeline using the prior output.NunchakuFluxTransformer2dModel.from_pretrained(transformer_path, torch_dtype=..., offload=...).NunchakuFluxTransformer2DModelV2.from_pretrained(transformer_path, torch_dtype=..., device=...).PipelineClass.from_pretrained(base_model, transformer=transformer, torch_dtype=...).torch.bfloat16 on Ampere/Ada/Hopper/Blackwell unless the task or GPU requires FP16. On Turing GPUs use torch.float16, call transformer.set_attention_impl("nunchaku-fp16") when available, and enable CPU offload if VRAM is tight.lora-and-adapters or performance-and-memory..safetensors/.sft path such as nunchaku-tech/nunchaku-flux.1-dev/svdq-int4_r32-flux.1-dev.safetensors, or a local path supplied by the user.nunchaku.utils.get_precision() when constructing public examples; it returns fp4 on Blackwell-class devices and int4 otherwise.cuda unless the caller explicitly asks for a device id such as cuda:1.NunchakuFluxTransformer2dModel, offload=True can be passed to transformer loading and paired with Diffusers sequential CPU offload. For NunchakuFluxTransformer2DModelV2, source inspection shows from_pretrained(..., offload=True) raises NotImplementedError; rely on Diffusers pipeline offload or choose the non-V2 class when transformer-level offload is required.NunchakuFluxTransformer2dModel.from_pretrained(..., return_metadata=True) path is documented in source as returning (transformer, metadata). Always unpack it explicitly and tolerate metadata is None for legacy directory-style loading.references/flux-workflows.md — model-family routing table, class choices, example call patterns, and API caveats.references/troubleshooting.md — common loading, dtype/device/offload, Turing, model access, and CUDA failure diagnoses.scripts/flux_minimal_template.py — parameterized one-image FLUX template for installed nunchaku environments.python scripts/flux_minimal_template.py \
--transformer nunchaku-tech/nunchaku-flux.1-dev/svdq-int4_r32-flux.1-dev.safetensors \
--base-model black-forest-labs/FLUX.1-dev \
--prompt "A cat holding a sign that says hello world" \
--output flux-output.png \
--dtype bf16 \
--device cuda
This command requires accessible model assets, a CUDA-capable Nunchaku installation, Diffusers, and any Hugging Face credentials required by the selected base or transformer models.
Native source candidates for a verifier include tests/flux/test_flux_examples.py, selected tests/v1/flux/test_flux1_*.py cases, and representative examples/flux*.py or examples/v1/flux*.py scripts. Treat them as candidates only; this sub-skill was drafted without running repository-native tests, examples, or benchmarks.