flux-model
fal.ai、Replicate、Black Forest Labs APIを通じて、高品質な画像生成や写真のようにリアルな画像を作成したり、LoRAファインチューニングで独自のスタイルを適用したり、実用的な画像生成パイプラインを構築したりするSkill。
📜 元の英語説明(参考)
FLUX image generation models — Flux Pro, Dev, and Schnell via fal.ai, Replicate, or Black Forest Labs API. Use when generating high-quality or photorealistic images, applying LoRA fine-tuning for custom styles, or building production image generation pipelines.
🇯🇵 日本人クリエイター向け解説
fal.ai、Replicate、Black Forest Labs APIを通じて、高品質な画像生成や写真のようにリアルな画像を作成したり、LoRAファインチューニングで独自のスタイルを適用したり、実用的な画像生成パイプラインを構築したりするSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o flux-model.zip https://jpskill.com/download/14911.zip && unzip -o flux-model.zip && rm flux-model.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14911.zip -OutFile "$d\flux-model.zip"; Expand-Archive "$d\flux-model.zip" -DestinationPath $d -Force; ri "$d\flux-model.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
flux-model.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
flux-modelフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
FLUX画像生成モデル
概要
Black Forest LabsのFLUXは、最先端のオープンウェイト画像生成アーキテクチャです。3つのモデル層があり、さまざまなニーズに対応します。
| モデル | 最適な用途 | 速度 | 品質 |
|---|---|---|---|
| Flux Pro | プロダクション、フォトリアリズム、商用 | 低速 | ⭐⭐⭐⭐⭐ |
| Flux Dev | オープンウェイト、LoRAファインチューニング、研究 | 中速 | ⭐⭐⭐⭐ |
| Flux Schnell | 速度、バッチ生成、プロトタイピング | 高速 | ⭐⭐⭐ |
FLUXには、fal.ai(推奨、最も簡単)、Replicate、またはBlack Forest Labs APIを直接使用してアクセスできます。
プロバイダー1: fal.ai (推奨)
セットアップ
pip install fal-client python-dotenv
export FAL_KEY="your_fal_api_key"
fal.aiで画像を生成する
import os
import base64
import fal_client
from pathlib import Path
def flux_fal(
prompt: str,
model: str = "fal-ai/flux-pro", # or flux/dev, flux/schnell
image_size: str = "landscape_4_3",
num_inference_steps: int = 28,
guidance_scale: float = 3.5,
num_images: int = 1,
output_format: str = "jpeg",
output_path: str = "output.jpg"
) -> list[str]:
"""
fal.aiを使用してFLUXで画像を生成します。
image_sizeのオプション: square_hd, square, portrait_4_3, portrait_16_9,
landscape_4_3, landscape_16_9 (またはカスタム WxH)
保存されたファイルパスのリストを返します。
"""
result = fal_client.subscribe(
model,
arguments={
"prompt": prompt,
"image_size": image_size,
"num_inference_steps": num_inference_steps,
"guidance_scale": guidance_scale,
"num_images": num_images,
"output_format": output_format,
"enable_safety_checker": True
}
)
saved = []
for i, image in enumerate(result["images"]):
# image["url"] は CDN URLです
import requests
r = requests.get(image["url"])
path = output_path if num_images == 1 else output_path.replace(".", f"_{i}.")
Path(path).write_bytes(r.content)
print(f"Saved: {path} ({len(r.content) // 1024} KB)")
saved.append(path)
return saved
# Flux Pro - 最高品質
flux_fal(
prompt="A hyperrealistic photo of a red sneaker floating in mid-air, studio lighting, white background",
model="fal-ai/flux-pro",
image_size="square_hd",
output_path="sneaker_pro.jpg"
)
# Flux Schnell - 高速生成
flux_fal(
prompt="Minimalist tech startup logo, geometric, dark blue and white",
model="fal-ai/flux/schnell",
num_inference_steps=4, # Schnell は 4 ステップでうまく機能します
output_path="logo_schnell.jpg"
)
fal.aiでのLoRA
def flux_dev_lora(prompt: str, lora_url: str, lora_scale: float = 0.9, output_path: str = "lora_output.jpg"):
"""カスタムスタイルのためのLoRAアダプターを使用してFlux Devで生成します。"""
result = fal_client.subscribe(
"fal-ai/flux-lora",
arguments={
"prompt": prompt,
"loras": [{"path": lora_url, "scale": lora_scale}],
"image_size": "landscape_4_3",
"num_inference_steps": 28,
"guidance_scale": 3.5,
"num_images": 1
}
)
import requests
r = requests.get(result["images"][0]["url"])
Path(output_path).write_bytes(r.content)
print(f"LoRA image saved: {output_path}")
flux_dev_lora(
prompt="A portrait in TOK style",
lora_url="https://huggingface.co/your-org/your-lora/resolve/main/lora.safetensors",
lora_scale=1.0
)
プロバイダー2: Replicate
セットアップ
pip install replicate
export REPLICATE_API_TOKEN="your_replicate_token"
Replicate経由で生成する
import replicate
import requests
from pathlib import Path
def flux_replicate(
prompt: str,
model: str = "black-forest-labs/flux-pro",
aspect_ratio: str = "1:1",
output_format: str = "jpg",
output_quality: int = 90,
output_path: str = "output.jpg"
) -> str:
"""
Replicate経由でFLUXで画像を生成します。
modelのオプション:
- black-forest-labs/flux-pro
- black-forest-labs/flux-dev
- black-forest-labs/flux-schnell
aspect_ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "2:3", "3:2"
"""
output = replicate.run(
model,
input={
"prompt": prompt,
"aspect_ratio": aspect_ratio,
"output_format": output_format,
"output_quality": output_quality,
"safety_tolerance": 2,
"prompt_upsampling": True # Proのみ: プロンプトを自動的に強化
}
)
# output は FileOutput オブジェクトのリストです
url = str(output[0])
r = requests.get(url)
Path(output_path).write_bytes(r.content)
print(f"Saved: {output_path}")
return output_path
flux_replicate(
prompt="Cinematic shot of a coffee cup on a wooden desk, morning light streaming through a window, 8k",
model="black-forest-labs/flux-pro",
aspect_ratio="16:9",
output_path="coffee_hero.jpg"
)
ReplicateでのLoRAを使用したFlux Dev
output = replicate.run(
"lucataco/flux-dev-lora:091495765fa5ef2725a175a57b276ec30dc9d39c22436ba424772c35501d6f",
input={
"prompt": "A photo of TOK person at the beach",
"hf_lora": "alvdansen/flux-koda", # HuggingFace LoRA パス
"lora_scale": 0.85,
"num_inference_steps": 28,
"guidance_scale": 3.5
}
)
プロバイダー3: Black Forest Labs API (直接)
セットアップ
export BFL_API_KEY="your_bfl_api_key"
BFL API経由で生成する
import os
import time
import requests
BFL_KEY = os.environ["BFL_API_KEY"]
BFL_HEADERS = {"x-key": BFL_KEY, "Content-Type": "application/json"}
def flux_bfl(
prompt: str,
model: str = "flux-pro-1.1", # flux-pro, flux-pro-1.1, flux-dev, flux-schnell
width: int = 1024,
height: int = 1024,
steps: int = None, # None = デフォルト
guidance: float = None,
output_path: str = "output.jpg"
) -> str:
"""生成
(原文がここで切り詰められています) 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
FLUX Image Generation Models
Overview
FLUX by Black Forest Labs is the leading open-weight image generation architecture. Three model tiers cover different needs:
| Model | Best For | Speed | Quality |
|---|---|---|---|
| Flux Pro | Production, photorealism, commercial | Slow | ⭐⭐⭐⭐⭐ |
| Flux Dev | Open weight, LoRA fine-tuning, research | Medium | ⭐⭐⭐⭐ |
| Flux Schnell | Speed, batch generation, prototyping | Fast | ⭐⭐⭐ |
Access FLUX via three providers: fal.ai (recommended, easiest), Replicate, or Black Forest Labs API directly.
Provider 1: fal.ai (recommended)
Setup
pip install fal-client python-dotenv
export FAL_KEY="your_fal_api_key"
Generate image with fal.ai
import os
import base64
import fal_client
from pathlib import Path
def flux_fal(
prompt: str,
model: str = "fal-ai/flux-pro", # or flux/dev, flux/schnell
image_size: str = "landscape_4_3",
num_inference_steps: int = 28,
guidance_scale: float = 3.5,
num_images: int = 1,
output_format: str = "jpeg",
output_path: str = "output.jpg"
) -> list[str]:
"""
Generate images using FLUX via fal.ai.
image_size options: square_hd, square, portrait_4_3, portrait_16_9,
landscape_4_3, landscape_16_9 (or custom WxH)
Returns list of saved file paths.
"""
result = fal_client.subscribe(
model,
arguments={
"prompt": prompt,
"image_size": image_size,
"num_inference_steps": num_inference_steps,
"guidance_scale": guidance_scale,
"num_images": num_images,
"output_format": output_format,
"enable_safety_checker": True
}
)
saved = []
for i, image in enumerate(result["images"]):
# image["url"] is a CDN URL
import requests
r = requests.get(image["url"])
path = output_path if num_images == 1 else output_path.replace(".", f"_{i}.")
Path(path).write_bytes(r.content)
print(f"Saved: {path} ({len(r.content) // 1024} KB)")
saved.append(path)
return saved
# Flux Pro - highest quality
flux_fal(
prompt="A hyperrealistic photo of a red sneaker floating in mid-air, studio lighting, white background",
model="fal-ai/flux-pro",
image_size="square_hd",
output_path="sneaker_pro.jpg"
)
# Flux Schnell - fast generation
flux_fal(
prompt="Minimalist tech startup logo, geometric, dark blue and white",
model="fal-ai/flux/schnell",
num_inference_steps=4, # Schnell works great with 4 steps
output_path="logo_schnell.jpg"
)
LoRA with fal.ai
def flux_dev_lora(prompt: str, lora_url: str, lora_scale: float = 0.9, output_path: str = "lora_output.jpg"):
"""Generate using Flux Dev with a LoRA adapter for custom style."""
result = fal_client.subscribe(
"fal-ai/flux-lora",
arguments={
"prompt": prompt,
"loras": [{"path": lora_url, "scale": lora_scale}],
"image_size": "landscape_4_3",
"num_inference_steps": 28,
"guidance_scale": 3.5,
"num_images": 1
}
)
import requests
r = requests.get(result["images"][0]["url"])
Path(output_path).write_bytes(r.content)
print(f"LoRA image saved: {output_path}")
flux_dev_lora(
prompt="A portrait in TOK style",
lora_url="https://huggingface.co/your-org/your-lora/resolve/main/lora.safetensors",
lora_scale=1.0
)
Provider 2: Replicate
Setup
pip install replicate
export REPLICATE_API_TOKEN="your_replicate_token"
Generate via Replicate
import replicate
import requests
from pathlib import Path
def flux_replicate(
prompt: str,
model: str = "black-forest-labs/flux-pro",
aspect_ratio: str = "1:1",
output_format: str = "jpg",
output_quality: int = 90,
output_path: str = "output.jpg"
) -> str:
"""
Generate image with FLUX via Replicate.
model options:
- black-forest-labs/flux-pro
- black-forest-labs/flux-dev
- black-forest-labs/flux-schnell
aspect_ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "2:3", "3:2"
"""
output = replicate.run(
model,
input={
"prompt": prompt,
"aspect_ratio": aspect_ratio,
"output_format": output_format,
"output_quality": output_quality,
"safety_tolerance": 2,
"prompt_upsampling": True # Pro only: auto-enhance prompt
}
)
# output is a list of FileOutput objects
url = str(output[0])
r = requests.get(url)
Path(output_path).write_bytes(r.content)
print(f"Saved: {output_path}")
return output_path
flux_replicate(
prompt="Cinematic shot of a coffee cup on a wooden desk, morning light streaming through a window, 8k",
model="black-forest-labs/flux-pro",
aspect_ratio="16:9",
output_path="coffee_hero.jpg"
)
Flux Dev with LoRA on Replicate
output = replicate.run(
"lucataco/flux-dev-lora:091495765fa5ef2725a175a57b276ec30dc9d39c22436ba424772c35501d6f",
input={
"prompt": "A photo of TOK person at the beach",
"hf_lora": "alvdansen/flux-koda", # HuggingFace LoRA path
"lora_scale": 0.85,
"num_inference_steps": 28,
"guidance_scale": 3.5
}
)
Provider 3: Black Forest Labs API (direct)
Setup
export BFL_API_KEY="your_bfl_api_key"
Generate via BFL API
import os
import time
import requests
BFL_KEY = os.environ["BFL_API_KEY"]
BFL_HEADERS = {"x-key": BFL_KEY, "Content-Type": "application/json"}
def flux_bfl(
prompt: str,
model: str = "flux-pro-1.1", # flux-pro, flux-pro-1.1, flux-dev, flux-schnell
width: int = 1024,
height: int = 1024,
steps: int = None, # None = default
guidance: float = None,
output_path: str = "output.jpg"
) -> str:
"""Generate image via BFL's native API."""
payload = {
"prompt": prompt,
"width": width,
"height": height,
"output_format": "jpeg",
"safety_tolerance": 2
}
if steps:
payload["steps"] = steps
if guidance:
payload["guidance"] = guidance
r = requests.post(f"https://api.bfl.ml/v1/{model}", json=payload, headers=BFL_HEADERS)
r.raise_for_status()
polling_id = r.json()["id"]
# Poll for result
while True:
poll = requests.get("https://api.bfl.ml/v1/get_result", params={"id": polling_id}, headers=BFL_HEADERS)
poll.raise_for_status()
data = poll.json()
if data["status"] == "Ready":
image_url = data["result"]["sample"]
break
elif data["status"] in ("Error", "Content Moderated", "Request Moderated"):
raise RuntimeError(f"BFL error: {data['status']}")
print(f"Status: {data['status']}...")
time.sleep(3)
img_data = requests.get(image_url).content
Path(output_path).write_bytes(img_data)
print(f"Saved: {output_path}")
return output_path
flux_bfl(
prompt="Ultra-detailed macro photo of a mechanical watch movement, studio lighting",
model="flux-pro-1.1",
width=1440,
height=1440,
output_path="watch_macro.jpg"
)
Parameters reference
| Parameter | Values | Description |
|---|---|---|
num_inference_steps |
4 (Schnell), 20–50 (Dev/Pro) | More steps = higher quality, slower |
guidance_scale |
1.5–5.0 | How closely to follow the prompt |
aspect_ratio / image_size |
1:1, 16:9, 9:16, etc. | Output dimensions |
| LoRA scale | 0.7–1.0 | Strength of LoRA style adapter |
Guidelines
- Flux Schnell: Use 4 steps. It's distilled — more steps don't improve quality.
- Flux Dev: Use 20–30 steps. Best for LoRA fine-tuning and customization.
- Flux Pro: Use 28–50 steps. Best for commercial quality and photorealism.
- For LoRA fine-tuning, use Flux Dev as the base (open weights). Flux Pro is proprietary.
- fal.ai is the easiest provider with the most complete feature set and lowest latency.
- BFL API gives direct access to the latest Pro model versions before other providers.
- Store API keys in environment variables — never hardcode them.