Skip to content

Add flexible CLI for image generation and improve project setup#2

Open
dandinu wants to merge 2 commits intoleochlon:mainfrom
dandinu:main
Open

Add flexible CLI for image generation and improve project setup#2
dandinu wants to merge 2 commits intoleochlon:mainfrom
dandinu:main

Conversation

@dandinu
Copy link
Copy Markdown

@dandinu dandinu commented Nov 16, 2025

Summary

This PR introduces a general-purpose command-line interface for ITO image generation, making it easy for users to generate images with custom prompts and parameters without writing code. It also improves the project setup with proper .gitignore configuration.

Changes

🎨 New: General-Purpose CLI Script (generate.py)

Added generate.py script that supports:

  • Custom prompts: Generate any image with --prompt "your prompt here"
  • Full parameter control: Configure all ITO and SDXL parameters via command-line arguments
  • Flexible output: Custom output filenames with --output flag
  • Optional comparison: Skip baseline generation with --no-comparison for faster iteration
  • Reproducibility: Control seed, steps, dimensions, budget, and more

Example usage:

# Quick generation with custom prompt
python generate.py --prompt "a futuristic city at sunset"

# Full control
python generate.py \
  --prompt "a majestic dragon" \
  --output dragon \
  --steps 50 \
  --seed 123 \
  --budget 50 \
  --lambda-max 8.0

# Fast iteration (skip baseline)
python generate.py -p "a serene lake" --no-comparison

Available options:

  • --prompt / -p: Main prompt
  • --negative / -n: Negative prompt
  • --output / -o: Output filename prefix
  • --seed, --steps, --height, --width: Generation parameters
  • --budget, --lambda-max, --alpha: ITO-specific parameters
  • --cfg: Baseline CFG value
  • --no-comparison: Skip baseline generation

📚 Documentation Updates

  • Added comprehensive Section 4: Command-Line Interface to README
  • Includes usage examples, complete options table, and output file descriptions
  • Renumbered subsequent sections for consistency
  • Makes it easier for users to get started without diving into Python code

🔧 Project Configuration

  • Added .gitignore to exclude:
    • Python artifacts (__pycache__/, *.pyc)
    • Virtual environments (.venv/, venv/)
    • Generated images (*.png, *.jpg)
    • IDE and OS files

Benefits

  1. Lower barrier to entry: Users can experiment with ITO without writing code
  2. Faster iteration: Command-line interface is quicker than editing Python scripts
  3. Better defaults: Maintains sensible defaults while allowing full customization
  4. Cleaner repo: .gitignore prevents committing generated files and artifacts
  5. Improved documentation: README now covers both CLI and programmatic usage

Backward Compatibility

✅ The Python API (ITOPipeline, generate_ito(), etc.) remains unchanged
✅ All existing code using the library will continue to work

Testing

The CLI has been tested with:

  • Default parameters
  • Custom prompts and parameters
  • Various output filenames
  • Skip baseline mode (--no-comparison)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant