Skip to main content

Tellers Network Image Generation Tool (tlnw-generate-image)

tlnw-generate-image is a standalone, publishable package that unifies AI image generation for stories and posts in the Tellers Network ecosystem. It supports OpenAI (DALL-E 2, DALL-E 3, gpt-image-2, and legacy gpt-image-1.5) as well as Google Gemini Imagen 4 models.

Installation

pip install tlnw-generate-image

Features

  • Extensible OOP Provider Architecture: Clean separation of model providers (DalleProvider, GptImageProvider, GoogleImagenProvider) with registry-based dynamic routing.
  • Intelligent Size & Quality Preset Mapping: Standardizes orientation presets (landscape, portrait, square) and qualities, automatically converting them to provider-native formats: aspect ratios (e.g. "16:9") for Google Imagen, or concrete dimensions (e.g. "1792x1024") for OpenAI.
  • Custom Dimension Resolution & Validation: Automatically maps exact resolution values (e.g., 1920x1080 or 1536x1024.txt in file names) to the closest supported native aspect ratios when routing to Imagen. For gpt-image-2, it validates custom resolution constraints locally (divisibility by 16, aspect ratios between 1:3 and 3:1, and a maximum resolution edge of 3840px with a minimum edge of 2160px).
  • Auto-resolution of Output Sizing: Extracts target sizes from prompt filename trailing suffixes (e.g., -1536x1024.txt).
  • Prompt Composition: Concatenates local directory illustration-master-prompt.txt automatically with individual scene prompts.
  • Automatic WebP Conversion: Generates and optimizes WebP formats (featured.webp and thumbnail.webp with max-dimension constraints).
  • Standardized Output Filenames: Output filenames are derived from the prompt file base: <prefix>-prompt.txt or <prefix>-prompt-<size>.txt become <prefix>.<ext>.
  • Optional WEBP Copy: Use --webp to create an additional lossless <prefix>.webp copy alongside the main output.
  • Thumbnail Generation: Use --thumbnail to create <prefix>-thumbnail.webp resized to max 768px with 75% quality.
  • Dry Run: Use --dry-run to run the full pipeline locally without calling remote image generation APIs. This creates small placeholder PNGs and performs conversions so you can validate outputs without API keys.
  • Recursive File Patterns: --file-pattern accepts glob patterns including ** for recursive discovery (e.g. --file-pattern "**/*-prompt-*.txt" root-folder).

Usage

Generate illustration for a story folder:

generate-image /path/to/story_folder --model dall-e-3 --webp --thumbnail

Process specific prompt files:

generate-image --file /path/to/prompt-1536x1024.txt --model imagen-4-ultra

Dry-run example (creates placeholders, no API calls):

generate-image /path/to/story_folder --dry-run --file-pattern "**/*-prompt-*.txt"

Download files

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

Source Distribution

tlnw_generate_image-0.6.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

tlnw_generate_image-0.6.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file tlnw_generate_image-0.6.0.tar.gz.

File metadata

  • Download URL: tlnw_generate_image-0.6.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tlnw_generate_image-0.6.0.tar.gz
Algorithm Hash digest
SHA256 89b862b56b93ef6dc41f960c595e666afc76abf566bde68ea6169ac28a8d5670
MD5 b8247620c64cf6f5a393ab3d647a2500
BLAKE2b-256 f59205d4568e040af1475902191acc906bbf88f74d3352579ad410856f17ed8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tlnw_generate_image-0.6.0.tar.gz:

Publisher: publish-to-pypi.yml on tellersnetwork/tlnw-generate-image

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

File details

Details for the file tlnw_generate_image-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tlnw_generate_image-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2921d8cb50fbe989ed8ae525412263435690c4e8f61576434ec23c69f47807bc
MD5 57396276dc314b7c0957c3a7048532b0
BLAKE2b-256 ccdf498b59cb5276a0f72da6adcc57c6fff1494fe86bffd793454d2adefb7969

See more details on using hashes here.

Provenance

The following attestation bundles were made for tlnw_generate_image-0.6.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on tellersnetwork/tlnw-generate-image

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

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page