Token导航 LogoToken导航TokenDH.com
图像处理执行命令clawhub未标认证来源可访问clear审计通过

mfluxmflux 图像

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

11,314

周安装

486

GitHub Stars

公开资料未说明

下载量

3,966
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mflux(mflux 图像)
来源仓库:https://github.com/pjain/mflux
安装命令:
openclaw skills install mflux
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install mflux

简介

通过 mflux 使用 Apple MLX 生成本地图像 — FLUX.2 Klein 4B(快速,Apache 2.0)和 Z-Image Turbo(质量)模型

SKILL.md

description
Local image generation using Apple MLX via mflux — FLUX.2 Klein 4B (fast, Apache 2.0) and Z-Image Turbo (quality) models

SKILL.md — mflux

Name

mflux

Description

Generate images locally using Apple Silicon via the mflux MLX implementation. Supports FLUX.2-klein-4B (default, fastest 4-step generation, Apache 2.0 licensed) and Z-Image-Turbo (6B, highest quality). All processing is on-device — no cloud, no API keys, no data leaving your Mac.

Requirements

  • Apple Silicon Mac (M1 or later)
  • Python 3.10+
  • macOS 13.5+
  • Recommended: 16GB+ RAM (8GB works with quantization)

Installation

1. Install mflux (via uv - recommended)

uv tool install --upgrade mflux --prerelease=allow

With faster downloads (optional):

uv tool install --upgrade mflux --with hf_transfer --prerelease=allow

2. Alternative: Install via pip

pip install -U mflux

3. Verify installation

mflux-generate --help
mflux-generate-z-image-turbo --help
mflux-generate-flux2 --help

Python API Usage

Quick Start — FLUX.2 Klein 4B (Default, Fastest)

from mflux.models.flux2.variants import Flux2Klein
from mflux.models.common.config import ModelConfig

model = Flux2Klein(model_config=ModelConfig.flux2_klein_4b())
image = model.generate_image(
    prompt="A serene Japanese garden with cherry blossoms, golden afternoon light",
    num_inference_steps=4,  # Only 4 steps needed!
    width=1024,
    height=768,
    seed=42,
)
image.save("garden.png")

Z-Image Turbo (Highest Quality)

from mflux.models.z_image import ZImage
from mflux.models.common.config import ModelConfig

model = ZImage(
    model_config=ModelConfig.z_image_turbo(),
    model_path="filipstrand/Z-Image-Turbo-mflux-4bit",  # 4-bit quantized
)
image = model.generate_image(
    prompt="A majestic eagle soaring over snow-capped mountains at sunset",
    num_inference_steps=9,
    width=1280,
    height=720,
    seed=42,
)
image.save("eagle.png")

With Quantization (Lower RAM)

from mflux.models.flux2.variants import Flux2Klein
from mflux.models.common.config import ModelConfig

model = Flux2Klein(
    model_config=ModelConfig.flux2_klein_4b(),
    quantize=8,  # 8-bit quantization
)
# ... generate image

Image-to-Image

from PIL import Image
from mflux.models.flux2.variants import Flux2Klein

model = Flux2Klein(model_config=ModelConfig.flux2_klein_4b())
image = model.generate_image(
    prompt="Transform into a watercolor painting",
    num_inference_steps=4,
    init_image=Image.open("source.jpg"),
    init_image_strength=0.3,  # 0.0-1.0, higher = more change
)
image.save("watercolor.png")

FLUX.2 Image Editing

from mflux.models.flux2.variants import Flux2KleinEdit
from mflux.models.common.config import ModelConfig

model = Flux2KleinEdit(model_config=ModelConfig.flux2_klein_4b())
image = model.generate_image(
    prompt="Make the person wear sunglasses",
    image_paths=["person.jpg", "sunglasses.jpg"],
    num_inference_steps=4,
    seed=42,
)
image.save("edited.png")

LoRA Support

from mflux.models.flux2.variants import Flux2Klein
from mflux.models.common.config import ModelConfig

model = Flux2Klein(
    model_config=ModelConfig.flux2_klein_4b(),
    lora_paths=["path/to/lora.safetensors"],
    lora_scales=[0.8],
)
# ... generate image

Supported Models

ModelCLI CommandSizeStepsSpeedQualityLicense
FLUX.2-klein-4b (default)mflux-generate-flux24B4⚡ Fastest⭐⭐⭐⭐Apache 2.0
FLUX.2-klein-9bmflux-generate-flux29B4⚡ Fast⭐⭐⭐⭐⭐Apache 2.0
Z-Image-Turbomflux-generate-z-image-turbo6B9⚡ Fast⭐⭐⭐⭐⭐Custom
Z-Image (base)mflux-generate-z-image6B50🐢 Slow⭐⭐⭐⭐⭐Custom
FLUX.2-klein-base-4bmflux-generate-flux24B50🐢 Slowest⭐⭐⭐⭐⭐Apache 2.0
Qwen-Imagemflux-generate-qwen20B20🐢 Slow⭐⭐⭐⭐⭐⭐Custom

CLI Reference

Generate with FLUX.2 Klein

# Default 4B model, 4 steps
mflux-generate-flux2 \
  --prompt "A photorealistic portrait of a wise old sailor" \
  --width 1024 \
  --height 768 \
  --steps 4 \
  --seed 42

# 9B model for higher quality
mflux-generate-flux2 \
  --model flux2-klein-9b \
  --prompt "A cyberpunk cityscape with neon lights" \
  --steps 4

# Base model (non-distilled, more steps)
mflux-generate-flux2 \
  --model flux2-klein-base-4b \
  --prompt "A detailed oil painting of a forest" \
  --steps 50 \
  --guidance 1.5

Generate with Z-Image Turbo

mflux-generate-z-image-turbo \
  --prompt "A minimalist logo design for a coffee shop" \
  --width 1280 \
  --height 720 \
  --steps 9 \
  --seed 42

# With LoRA
mflux-generate-z-image-turbo \
  --prompt "Art nouveau style portrait of a woman" \
  --steps 9 \
  --lora-paths "renderartist/Art-Nouveau-Style" \
  --lora-scales 0.7

With Quantization

mflux-generate-flux2 \
  --prompt "A serene landscape" \
  --quantize 8  # 8-bit quantization (reduces RAM)

# Or 4-bit for lowest RAM
mflux-generate-flux2 \
  --prompt "A serene landscape" \
  --quantize 4

Parameters

ParameterTypeDefaultDescription
promptstrrequiredText description of image
widthint1024Image width in pixels
heightint768Image height in pixels
num_inference_stepsint4 (Klein), 9 (Z-Image)Number of denoising steps
seedintrandomRandom seed for reproducibility
quantizeintNoneQuantization level (4, 8)
guidancefloat1.0 (Klein) / 4.0 (Z-Image)Guidance scale (base models only)
lora_pathslistNoneList of LoRA file paths
lora_scaleslistNoneLoRA blending scales
init_imagePIL.ImageNoneSource image for img2img
init_image_strengthfloat0.3Strength of transformation

Aspect Ratios (Recommended Sizes)

Aspect RatioDimensionsUse Case
1:11024×1024Profile photos, icons
4:31024×768Photo standard
16:91024×576 or 1280×720Landscape, videos
3:4768×1024Portrait orientation
9:16720×1280Mobile vertical
21:91280×550Cinematic widescreen

Performance & RAM Guide

ConfigurationRAMSpeedBest For
FLUX.2-klein-4b, q=8~5 GB~8 sec8GB Macs
FLUX.2-klein-4b, q=4~4 GB~5 secLow RAM
FLUX.2-klein-4b, q=None~8 GB~15 secQuality on 16GB
FLUX.2-klein-9b, q=8~12 GB~20 secBest quality 16GB
Z-Image-Turbo, q=4~5 GB~12 secAll-around 8GB

Model Weights

Models are downloaded automatically on first use:

  • FLUX.2-klein-4b: ~15GB
  • FLUX.2-klein-9b: ~32GB
  • Z-Image-Turbo quantized: ~8GB

Cache location: ~/.cache/huggingface/

Comparison: When to Use Which

Choose FLUX.2-klein-4b when:

  • Speed is priority (4 steps, ~5-8 sec)
  • Apache 2.0 license needed (commercial use)
  • Generating many images fast
  • 8GB+ RAM available

Choose Z-Image-Turbo when:

  • Quality is priority
  • Realism matters most
  • You have 16GB+ RAM
  • Time per image acceptable

Choose FLUX.2-klein-9b when:

  • Best quality from Apache-licensed model
  • 16GB+ RAM available
  • Commercial use required

Error Handling

ErrorCauseFix
OutOfMemoryErrorNot enough RAMUse quantization (q=8, q=4)
ValueError: Model not foundFirst run / cache issue

适合场景

01

文本生成图片

02

图片风格化

03

产品图和创意图

04

需要 FLUX 模型时

能力概览

能力 1

调用 FLUX 图像模型

能力 2

支持文本生图和图像改写

能力 3

覆盖 LoRA 或风格适配

能力 4

适合创意视觉生成

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

87.11%
按下载量换算3,455

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install mflux 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills