Skip to main content

Generate ICRL thought-of-the-day images using LiteLLM, PIL, and Typer.

Project description

ICRL Generator

This project generates polished “thought of the day” images for the International Consciousness Research Laboratories (ICRL).
It uses LiteLLM to:

  1. Turn a text thought into an image prompt
  2. Generate an AI image
  3. Add fully-wrapped, centered text to the top-right of the final image

The script is exposed as a command-line tool using Typer.


Features

  • Generate text-to-image prompts using LiteLLM (completion)
  • Produce images using LiteLLM (image_generation)
  • Automatically wrap overlay text with pixel-accurate measurement
  • Save:
    • the final processed image
    • the raw generated image (optional)
    • the generated image prompt (optional)
  • Easy CLI interface

Installation

git clone https://github.com/HonakerM/icrl-generator.git
cd icrl-generator
pip install .

Usage

CLI

After installation, you can run the following command to generate an image.

Linux:

export OPENAI_API_KEY = "<openai-api-key>"
icrl-gen \
    --image-prompt-output image-prompt.txt \
    --raw-image-output raw_image.png \
    --log-level DEBUG \
    "Never assume that what you see on a person’s face is what lies in their heart. A frown is not always intended for you, a smile is not always indicative of friendliness or happiness" \
    image.png

Windows:

$env:OPENAI_API_KEY = "<openai-api-key>"   
icrl-gen `
    --image-prompt-output image-prompt.txt `
    --raw-image-output raw_image.png `
    --log-level DEBUG `
    "Never assume that what you see on a person’s face is what lies in their heart. A frown is not always intended for you, a smile is not always indicative of friendliness or happiness" `
    image.png

To view the options and their descriptions you can run:

icrl-gen --help

to see all available commands.

Code

If you want to call it from Python directly:

from pathlib import Path
from icrl_generator import generate_image

generate_image(
    thought="Reality responds to our expectations.",
    output=Path("out.png"),
    image_prompt_output=Path("prompt.txt"),
    raw_image_output=Path("raw.png")
)

Results

./image.png

Requirements

  • Python 3.10+
  • LiteLLM API keys properly configured (export OPENAI_API_KEY=...)
  • Pillow
  • Typer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icrl_generator-0.0.0.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icrl_generator-0.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file icrl_generator-0.0.0.tar.gz.

File metadata

  • Download URL: icrl_generator-0.0.0.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for icrl_generator-0.0.0.tar.gz
Algorithm Hash digest
SHA256 69a05f7e670c1d6f4154fb684b0ff41d3921e20a606f3d45101bbd66d1d50af0
MD5 753d601a08544bd96fdec28c40740d0f
BLAKE2b-256 78f0701f3d16395f2ed09e57f6bbbc25e0bda6b1bd02ad29ab3ce580a097a2f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for icrl_generator-0.0.0.tar.gz:

Publisher: publish.yml on HonakerM/icrl-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file icrl_generator-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: icrl_generator-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for icrl_generator-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3beafda73a1073b2cbc5c809acf239ab96584cd344b028e0f3b891772e03e385
MD5 8b1eb0459fc62d15ad57082fd816b9b4
BLAKE2b-256 ed8c26d5c265f91aebd131b5b97ee726b6e176661fe8f3801cdb90438eaecf43

See more details on using hashes here.

Provenance

The following attestation bundles were made for icrl_generator-0.0.0-py3-none-any.whl:

Publisher: publish.yml on HonakerM/icrl-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page