agentleFS
runafreyjasdottirrunafreyjasdottir/hermes-skills-open/flux-image-gen/SKILL.md

flux-image-gen

Skill4 starsChanged 7 months agoMITView on GitHub

Flux.1 image generation — fast, beautiful AI art via ComfyUI, Fal.ai, or Replicate. Better than SDXL for prompts and text-in-image.

  • Installs packages

The file

Files
SKILL.md

Flux.1 Image Generation

Generate beautiful AI art with Flux.1 — the state-of-the-art open model that beats SDXL and rivals Midjourney.

Why Flux?

FeatureFlux.1SDXLMidjourney
Prompt Adherence⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Text-in-Image⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
SpeedFastFastMedium
ControlFullFullLimited
CostFree (local)Free (local)$10-30/mo
NSFW✅ Yes✅ Yes❌ No

Flux excels at:

  • ✅ Complex prompts (multiple elements)
  • ✅ Text rendering (signs, labels)
  • ✅ Hands/faces (no more 6 fingers!)
  • ✅ Photorealism
  • ✅ Artistic styles
  • ✅ Character consistency

Quick Start

Option 1: Local (ComfyUI) — FREE

Requirements:

  • NVIDIA GPU with 8GB+ VRAM (12GB+ for Flux Dev)
  • Or Apple Silicon M1/M2/M3 with 16GB+ unified memory
  • 30GB+ disk space

Setup:

# Install via comfy-cli (see comfyui skill)
pipx install comfy-cli
comfy --skip-prompt install --nvidia
comfy launch --background

# Download Flux model
comfy model download \
  --url "https://huggingface.co/Comfy-Org/flux1-dev/resolve/main/flux1-dev-fp8.safetensors" \
  --relative-path models/checkpoints

Option 2: Fal.ai — FAST (Cloud)

Requirements:

Setup:

export FAL_KEY="your-fal-key"
pip install fal-client

Option 3: Replicate — RELIABLE (Cloud)

Requirements:

Setup:

export REPLICATE_API_TOKEN="your-replicate-token"
pip install replicate

Usage

Local (ComfyUI + Python)

import requests, json

def generate_flux_local(prompt, negative="", steps=30, cfg=7, seed=-1):
    """Generate image via local ComfyUI"""
    
    # Load workflow template
    with open("workflows/flux_dev_txt2img.json") as f:
        workflow = json.load(f)
    
    # Inject prompt
    workflow["3"]["inputs"]["text"] = prompt
    workflow["3"]["inputs"]["text_negative"] = negative
    workflow["3"]["inputs"]["steps"] = steps
    workflow["3"]["inputs"]["cfg"] = cfg
    if seed > 0:
        workflow["3"]["inputs"]["seed"] = seed
    
    # Submit to ComfyUI
    response = requests.post(
        "http://127.0.0.1:8188/prompt",
        json={"prompt": workflow}
    )
    prompt_id = response.json()["prompt_id"]
    
    # Wait and download (see comfyui/run_workflow.py)
    # Returns: path to generated image
    return download_output(prompt_id)

# Example
image_path = generate_flux_local(
    "A Norse warrior standing on a cliff, northern lights, photorealistic, 8k"
)

Fal.ai (Cloud API)

import fal_client

def generate_flux_fal(prompt, width=1024, height=1024, steps=28):
    """Generate image via Fal.ai"""
    
    handler = fal_client.submit(
        "fal-ai/flux/dev",
        arguments={
            "prompt": prompt,
            "image_size": {"width": width, "height": height},
            "num_inference_steps": steps,
            "guidance_scale": 3.5,
            "num_images": 1
        }
    )
    
    result = handler.get()
    return result["images"][0]["url"]

# Example
image_url = generate_flux_fal(
    "A cyberpunk Viking with neon runes, dark atmosphere, cinematic lighting"
)
print(f"Image: {image_url}")

Replicate (Cloud API)

import replicate

def generate_flux_replicate(prompt, width=1024, height=1024, steps=28):
    """Generate image via Replicate"""
    
    output = replicate.run(
        "black-forest-labs/flux-dev",
        input={
            "prompt": prompt,
            "width": width,
            "height": height,
            "num_inference_steps": steps,
            "guidance_scale": 3.5
        }
    )
    
    # Returns list of image URLs
    return output[0]

# Example
image_url = generate_flux_replicate(
    "Ancient Norse temple in snowy mountains, mystical atmosphere"
)
print(f"Image: {image_url}")

Prompt Engineering

Basic Structure

[Subject], [Action/Pose], [Environment], [Lighting], [Style], [Quality]

Example:

A Viking shieldmaiden, wielding a glowing axe, 
standing in a snowy forest at dusk, 
volumetric lighting through trees, 
photorealistic, cinematic, 8k, highly detailed

Negative Prompts (Local Only)

ugly, deformed, noisy, blurry, distorted, 
out of focus, bad anatomy, extra limbs, 
poorly drawn hands, poorly drawn face, mutation

Style Keywords

StyleKeywords
Photorealphotorealistic, cinematic, 8k, highly detailed, ray tracing
Fantasy Artfantasy art, digital painting, artstation, greg rutkowski
Animeanime, manga, makoto shinkai, studio ghibli, cel shaded
Cyberpunkcyberpunk, neon, sci-fi, blade runner, futuristic
Norse/Vikingnorse, viking, ancient, runes, mystical, seidr
Oil Paintingoil painting, classical, renaissance, rembrandt
Pixel Artpixel art, 16-bit, retro, game sprite

Text-in-Image

Flux excels at rendering text:

A wooden sign that reads "VALHALLA" in Norse runes, 
hanging outside a Viking longhouse, snowy winter
A cyberpunk street scene with neon signs reading 
"RAMEN" and "CYBER CAFE" in Japanese and English

Advanced Techniques

Image-to-Image

# Fal.ai img2img
handler = fal_client.submit(
    "fal-ai/flux/dev/img2img",
    arguments={
        "prompt": "Make it winter, add snow",
        "image_url": "https://example.com/original.jpg",
        "strength": 0.7  # 0=no change, 1=complete rewrite
    }
)

Inpainting (Edit Specific Areas)

# Upload mask (white = edit, black = keep)
handler = fal_client.submit(
    "fal-ai/flux/dev/inpaint",
    arguments={
        "prompt": "Add glowing Norse runes on the armor",
        "image_url": "https://example.com/character.jpg",
        "mask_url": "https://example.com/mask.png",
    }
)

Upscaling

# 4x upscale
handler = fal_client.submit(
    "fal-ai/flux/dev/upscale",
    arguments={
        "image_url": "https://example.com/low_res.jpg",
        "scale_factor": 4
    }
)

Character Consistency

For consistent characters across multiple images:

# Use same seed + detailed description
base_prompt = """
A Viking warrior named Bjorn, 
red beard, blue eyes, leather armor with iron studs,
scar over left eye
"""

# Generate multiple images with same seed
for i in range(4):
    image = generate_flux_fal(
        f"{base_prompt}, scene variation {i}",
        seed=42  # Same seed for consistency
    )

Workflows

Norse Character Portrait

prompt = """
Portrait of a Norse shieldmaiden, 
long braided red hair, war paint on face,
fur cloak over chainmail, holding battle axe,
snowy mountain background, dramatic lighting,
photorealistic, 8k, cinematic, highly detailed
"""

negative = """
ugly, deformed, noisy, blurry, bad anatomy,
poorly drawn face, mutation, disfigured
"""

image = generate_flux_fal(prompt, negative_prompt=negative)

Viking Longhouse Interior

prompt = """
Interior of a Viking longhouse, 
wooden beams, fire pit in center,
fur rugs on benches, weapons on walls,
warm firelight, atmospheric smoke,
photorealistic, 8k, architectural photography
"""

image = generate_flux_local(prompt, steps=35, cfg=7)

Norse Mythology Scene

prompt = """
Yggdrasil, the World Tree, 
glowing roots extending into cosmic void,
nine realms visible in branches,
nordic runes floating in the air,
fantasy art, digital painting, epic scale,
by greg rutkowski and artgerm
"""

image = generate_flux_replicate(prompt)

Cyber-Viking Fusion

prompt = """
Cyberpunk Viking with neon rune tattoos,
mechanical arm with Norse engravings,
standing in futuristic Asgard,
holographic ravens Huginn and Muninn,
neon purple and blue lighting,
cyberpunk, sci-fi, cinematic
"""

image = generate_flux_fal(prompt)

Batch Generation

# Generate multiple variations
prompts = [
    "Norse warrior in snow storm",
    "Norse warrior at sunset",
    "Norse warrior in forest",
    "Norse warrior on ship"
]

for i, prompt in enumerate(prompts):
    image = generate_flux_fal(prompt, seed=i)
    save_image(image, f"warrior_{i}.png")

Common Pitfalls

IssueSymptomSolution
OOM (Out of Memory)CUDA out of memoryUse flux1-dev-fp8 (smaller), reduce resolution, or use cloud
Slow generation30+ seconds per imageUse -fast variant, reduce steps to 20-25, or use Fal.ai
Bad hands/facesDistorted anatomyAdd highly detailed, perfect anatomy to prompt, increase steps
Text garbledUnreadable textUse quotes around text, simplify, Flux is best but not perfect
Prompt ignoredImage doesn't matchIncrease CFG to 5-7, be more specific in prompt
Cloud API failsAuthentication errorCheck API key, ensure credits available
ComfyUI missing nodesWorkflow errorsRun comfy node install-deps --workflow=flux.json

Performance Comparison

Local (RTX 4070, 12GB VRAM)

ModelResolutionStepsTime
Flux Dev (fp8)1024x102428~15s
Flux Dev (fp8)1024x102435~20s
Flux Dev (fp16)1024x102428~25s
SDXL1024x102430~8s

Cloud (Fal.ai)

ModelResolutionStepsTimeCost
Flux Dev1024x102428~3-5s~$0.03
Flux Dev1024x102435~5-7s~$0.04
Flux Pro1024x102428~3-5s~$0.05

Integration with Other Skills

With comfyui

Flux is a subset of ComfyUI — use the full comfyui skill for advanced workflows:

# Use ComfyUI skill's run_workflow.py
python3 scripts/run_workflow.py \
  --workflow workflows/flux_dev_txt2img.json \
  --args '{"prompt": "Norse warrior", "steps": 30}'

With unreal-engine-dev

Generate textures for UE5:

# Generate seamless texture
texture = generate_flux_fal(
    "Seamless stone texture, Norse carvings, 4k, tileable",
    width=2048, height=2048
)

# Import to UE5
import_to_ue5(texture, "Content/Textures/Stone_Norse.png")

With grok-ai

Have Grok write prompts, Flux generate:

# Ask Grok for prompt ideas
prompt_ideas = grok_chat(
    "Give me 5 detailed image prompts for Norse mythology scenes"
)

# Generate each one
for prompt in parse_prompts(prompt_ideas):
    image = generate_flux_fal(prompt)

Verification Checklist

  • Chosen backend (local ComfyUI, Fal.ai, or Replicate)
  • API keys configured (if using cloud)
  • Test generation successful
  • Prompt templates saved
  • Output directory organized
  • Integration with other skills tested

Related Skills

  • comfyui — Full ComfyUI workflows (Flux is a subset)
  • unreal-engine-dev — Use Flux for UE5 textures/concept art
  • grok-ai — Generate prompts with Grok
  • pixel-art — Alternative for retro aesthetics
  • wyrd-protocol-world-model — Generate character portraits for NPCs

Resources


Skill woven by Runa Gridweaver — may your generations be swift and your artifacts beautiful. 🌙🎨⚡

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.