Beam Search Demo - Real-time Messages

πŸ” What is Beam Search?

Beam Search is an iterative refinement algorithm that explores multiple candidate solutions in parallel:

πŸ’‘ Think of it like a tournament: Start with many competitors, eliminate weaker ones each round, and refine the best ones.

Configuration

Required. Your key stays in your browser session only and is sent directly to OpenAI via HTTPS. Not stored on our server. Get a key at OpenAI API Keys
Describe what you want to generate. Be specific with styles, composition, and mood.
Examples: "A serene forest lake with autumn colors, oil painting style" or "A futuristic city at night, cyberpunk aesthetic"
How many diverse initial candidates to generate. More = broader exploration but higher cost.
How many best candidates to keep for refinement each iteration. Lower = more filtering, faster convergence.
Number of refinement rounds. More iterations = better quality but higher cost and time.
⚠️ Keep Top (M) especially impacts costsβ€”each higher M with multiple iterations multiplies comparison overhead.
Weights prompt alignment vs. visual quality. Low (0.0-0.3): Prioritize beauty over exact prompt matching | Medium (0.4-0.6): Balance both equally | High (0.7-1.0): Ensure images match your prompt exactly
Randomness in prompt generation. Low (0.0-0.3): Predictable, focused | High (0.7-1.0): Creative, diverse

Model Selection (Optional)

Choose which AI models to use. Default models work great for most users.
πŸ“Š Estimated Cost: Calculating...

Used for generating and refining prompts at each iteration.
nano: $0.025/1M | mini: $0.125/1M | gpt-5: $0.625/1M
Compares generated images to find the best candidate at each iteration.
mini: $2.50/1M in, $8/1M out | standard: $10/1M in, $40/1M out
Analyzes images to provide critiques and suggestions for refinement.
nano: $0.025/1M | mini: $0.125/1M | gpt-5: $0.625/1M

πŸ’° Cost Considerations:

  • Estimated cost is shown above and updates as you change parameters
  • Image generation costs ~$0.04 per image (varies by size/quality)
  • Ranking with image comparison models is the largest cost component
  • Start with N=4, M=2, Iterations=2 for quick/cheap testing (~$0.50)
  • Use N=2, M=1, Iterations=1 for minimal cost exploration (~$0.15)

Real-Time Progress

Ready
Idle
What you'll see: πŸ”„ Iteration progress | πŸ“Š Ranking comparisons | βœ… Completion status | πŸ’¬ Live cost updates | 🎨 Generated images appear above

Candidate Prompts