Skip to content

Autoresearch: image prompt optimization loop #23

@realityinspector

Description

@realityinspector

Summary

Add a Karpathy-style autoresearch loop that autonomously optimizes Flash's image generation prompts by exploring the prompt mutation space and tracking quality vs cost.

What's in the branch

Branch autoresearch/flash/image-prompts adds:

  • autoresearch/__init__.py — module docstring
  • autoresearch/flash_autoresearch.py — the optimization loop

Mutation space

  • Style keywords: photorealistic, cinematic, oil painting, watercolor, etc. (15 options)
  • Lighting terms: golden hour, chiaroscuro, neon glow, etc. (14 options)
  • Composition terms: rule of thirds, dutch angle, shallow DoF, etc. (13 options)
  • Detail levels: minimal through ultra-8k (6 options)
  • CFG guidance scale: 3.0–15.0 continuous
  • Negative prompts: 6 options including none

Modes

  • --dry-run: Synthetic CLIP scores derived from config hash (deterministic + small Gaussian noise). No API calls. Good for testing the loop mechanics.
  • Live mode (not yet wired): Calls Flash API to generate images, scores with CLIP similarity.

Outputs

  • results.jsonl — per-iteration records with config, CLIP score, cost, quality-per-dollar
  • pareto.json — Pareto frontier of quality vs cost

Usage

PYTHONPATH=. python3 -m autoresearch.flash_autoresearch --dry-run --iterations 10

Next steps

  • Wire live mode to Flash API endpoint
  • Add CLIP scoring (or LLM judge) for generated images
  • Integrate with SNAG-Bench for composite quality metric
  • Run overnight optimization pass (~$50 for 50 iterations)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions