Skip to content

Image Workflows

The high-engagement image post workflow generates static social media graphics with dynamic visuals and coherent text overlays designed to maximize engagement. Unlike video thumbnails, these are standalone graphic-design-oriented posts for platforms like Instagram, Twitter, LinkedIn, and Pinterest.

Terminal window
# From a niche/topic — generates hooks, then images
fabric run media/high-engagement-posts \
--input niche="AI productivity tools" \
--input platforms='["instagram-square", "twitter"]'
# From pre-existing hooks (skip hook generation)
fabric run media/high-engagement-posts-from-hooks \
--input hook_ideas='[{"hook_text": "Stop using ChatGPT wrong"}]'
# Trending topics → posts (composed pipeline)
fabric run global/hot-topics-to-posts
gather_competitor_insights → gather_trend_signals → generate_hook_ideas →
craft_image_prompts → generate_post_images → score_post_images →
prepare_post_output
craft_image_prompts → generate_post_images → score_post_images →
prepare_post_output
hot_topics_pipeline → bridge_topics_to_hooks → generate_hook_ideas →
craft_image_prompts → generate_post_images → score_post_images →
prepare_post_output

Takes hook ideas and produces image_specs[] — one per hook and platform combination.

  • Condenses hooks to 1-5 word overlays (ALL CAPS, bold)
  • LLM generates per-hook: visual concept, color direction, layout type, typography guidance
  • Applies high-engagement design principles:
    • Typography is the hero — text IS the content
    • High contrast (dark text on light, white/yellow on dark gradient)
    • Color psychology: red/orange = urgency, yellow = attention, blue = trust
    • Clean negative space, no busy backgrounds
    • Readable at phone-screen thumbnail size
    • Graphic design aesthetic, not photography

Two generation paths, automatically selected based on the configured model:

Uses Gemini’s native text rendering to generate images with text baked in:

  • Text overlay is part of the image generation prompt
  • Produces coherent, styled, visually integrated text
  • Best quality for text-heavy engagement posts

Each image spec generates num_variants (default 3) variants for selection.

Sends generated images back to Gemini vision for quality scoring (1-10) across:

DimensionDescription
text_readabilityCan the text be read at thumbnail size?
visual_impactDoes the image grab attention in a scroll?
text_image_coherenceDo text and visual work together?
click_appealWould you stop and click?
platform_fitDoes it match the platform’s aesthetic?

Images below threshold (default 6.0) are flagged. Set auto_regenerate=true to automatically retry low-scoring images.

Ranks results by score and identifies the best variant per platform.

ParameterTypeDefaultDescription
nichestringrequiredContent niche for hook generation
hook_ideaslist[dict]generatedPre-existing hooks (skips generation)
platformslist[str]["instagram-square", "twitter"]Target platforms
brand_stylestring""Brand style guidelines
num_variantsint3Variants per image spec
auto_regenerateboolfalseAuto-retry low-scoring images
qualitystring""Quality preset (affects image model)
PlatformDimensionsAspect Ratio
instagram-square1080 x 10801:1
instagram-portrait1080 x 13504:5
instagram-story1080 x 19209:16
twitter1200 x 67516:9
facebook1200 x 63016:9
linkedin1200 x 62716:9
pinterest1000 x 15002:3
threads1080 x 10801:1
{
"posts": [
{
"hook_text": "Stop using ChatGPT wrong",
"overlay_text": "STOP USING CHATGPT WRONG",
"platform": "instagram-square",
"image_path": "/tmp/post_001.png",
"scores": {
"text_readability": 8,
"visual_impact": 9,
"text_image_coherence": 7,
"click_appeal": 8,
"platform_fit": 9
},
"overall_score": 8.2,
"variant_index": 0,
"generation_method": "gemini_native"
}
],
"best_per_platform": {
"instagram-square": 0,
"twitter": 2
},
"workflow": "high-engagement-posts"
}

The workflow uses a post operation in the model configuration system:

ProfileModelText Rendering
(default)gemini-3.1-flash-image-previewNative (in-image)
premiumgemini-3.1-flash-image-previewNative (in-image)
localsdxl-turboPIL overlay
local-powerflux-schnellPIL overlay

Override per-run:

Terminal window
fabric run media/high-engagement-posts \
--input niche="AI tools" \
--input post_model="flux-schnell"

The craft_image_prompts task selects a layout type for text placement:

LayoutDescription
centeredSemi-transparent dark rectangle centered, text centered within
bannerSolid/gradient band across top or bottom third
splitDark half on left or right, text on the dark side
gradientGradient overlay from bottom, text in lower portion

Workflow: image/generate-actors

Generates AI actor portrait images via Gemini Imagen 3, uploads them as Fabric assets, and populates a portrait gallery. Used to create consistent character images for video workflows.

Terminal window
# Default (1 professional actor, system gallery)
fab-workflow image/generate-actors
# Custom actors for an org
fab-workflow image/generate-actors \
--input 'actors=[{"description": "young tech founder, casual style", "tags": ["male", "casual"]}]' \
--input gallery_name="my-actors" \
--input concurrency=4
resolve_actors → ensure_gallery → generate_and_upload → populate_gallery
ParameterTypeDefaultDescription
actorslist[dict]1 default actorActor descriptions with description and tags fields
gallery_namestring"default-portraits"Gallery name to populate
aspect_ratiostring"3:4"Portrait aspect ratio
concurrencyint4Parallel generation limit
{
"generated_actors": [
{
"description": "young tech founder, casual style",
"image_path": "/tmp/actor_001.png",
"asset_id": "018f...",
"gallery_item_id": "..."
}
],
"gallery_id": "...",
"gallery_name": "my-actors"
}

Workflow: global/image-edit

Modifies an existing image using natural-language prompts via img2img. Analyzes the source image with vision, applies the edit through one of three backends (Gemini, fal.ai FLUX, or local diffusers), and evaluates the result.

Terminal window
# Basic edit
fab run global/image-edit \
--input image_path=photo.jpg \
--input prompt="Add dramatic lighting and warm tones"
# Control strength (0.0=preserve, 1.0=reimagine)
fab run global/image-edit \
--input image_path=photo.jpg \
--input prompt="Make it look like a watercolor painting" \
--input strength=0.8
# Generate multiple variants
fab run global/image-edit \
--input image_path=photo.jpg \
--input prompt="Change the background to a beach sunset" \
--input num_variants=3 \
--input preserve='["subject", "composition"]'
analyze_source (vision) → apply_edit (img2img) → evaluate_edit (score)

The strength parameter controls how much the output deviates from the original:

StrengthEffectUse Case
0.1-0.3Subtle adjustmentsColor correction, minor touch-ups
0.4-0.6Moderate changes (default)Style transfer, lighting changes, background swap
0.7-0.9Major transformationArtistic reimagining, genre change
1.0Nearly full regenerationComplete reimagining guided only by prompt

The workflow automatically routes to the best available backend:

BackendModelBest For
Gemini (default)gemini-2.5-flashGeneral-purpose editing with strong instruction following
fal.ai FLUXfal-ai/flux/dev/image-to-imageHigh-quality style transfer and artistic edits
Local diffuserssdxl-turbo, flux-schnellOffline/free editing, fast iteration

Override with --input image_edit_model="fal-ai/flux/dev/image-to-image" or set quality profiles (--input quality=local).

ConstraintWhat it preserves
compositionLayout, framing, spatial arrangement
colorsColor palette and color relationships
subjectMain subject identity and features
styleArtistic style, medium, technique
lightingLight direction, intensity, mood
ParameterTypeDefaultDescription
image_pathstringrequiredSource image (local path or URL)
promptstringrequiredWhat to change
strengthfloat0.6Deviation from original (0.0-1.0)
preservelist[str][]Aspects to keep unchanged
aspect_ratiostring""Output aspect ratio (empty = preserve original)
num_variantsint1Number of variants to generate (1-4)
{
"edited_image_path": "/tmp/fabric_edit_abc123.png",
"variant_paths": ["/tmp/fabric_edit_def456.png"],
"original_description": "A person standing in a park with autumn trees",
"edit_description": "Added dramatic golden-hour lighting with warm orange tones",
"fidelity_score": 8.5
}

The edit_image() function is also available directly in the SDK for use in custom workflows:

from fabric_workflow_sdk import edit_image
# In any workflow task
edited_path = await edit_image(
input,
"Add a sunset sky",
"source.jpg",
strength=0.6,
)