Skip to content
This repository was archived by the owner on Jun 30, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script for batch generation of images using the Leo AI API.

LEONARDO_API_KEY should be set as environment variable or mise.toml file like:

LEONARDO_API_KEY=your_api_key_here

You can change constants in main.py.

Constants

MAX_PENDING_GENERATIONS = 200 RATE_LIMIT_REQUESTS = 100 RATE_LIMIT_PERIOD = 60 # seconds RETRY_DELAY = 5 # seconds

Also you can change arguments of the script like workload(path to json file(s) with schema defined in workload_example.json) and output directory

This how it process (from main.py):

    parser = argparse.ArgumentParser(description="Leonardo AI Batch Image Generator")
    parser.add_argument(
        "-w",
        "--workload",
        nargs="+",
        required=True,
        help="Шлях до одного або декількох JSON файлів workload",
    )
    parser.add_argument(
        "-o",
        "--output",
        default="output",
        help="Папка для збереження результатів (за замовчуванням: 'output')",
    )
    args = parser.parse_args()

    api_key = os.environ.get("LEONARDO_API_KEY")
    if not api_key:
        print(
            "Помилка: Не знайдено змінну середовища LEONARDO_API_KEY. Будь ласка, встановіть її."
        )
        sys.exit(1)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages