Skip to main content

Dynamic Prompts Image Generator

This application integrates the dynamicprompts library with a Gradio UI to generate images with sequential artist cycling and random general/elements.

Features

  • Sequential artist switching (cyclical sampler)
  • Random general and elements selection
  • Custom save location for generated images
  • Easy-to-use Gradio interface

How It Works

The application uses the dynamicprompts library to handle prompt generation with different sampling methods:

  • Sequential Artist Switching: Uses the cyclical sampler (@) to cycle through artists one by one
  • Random General and Elements: Uses the default random sampler to randomly select from general and element options

For example, when you provide a template like:

A painting by {artist}, {landscape|portrait|still life}, {vibrant colors|muted tones|black and white}

The application will:

  1. Replace {artist} with {@artist1|artist2|artist3} (using the cyclical sampler)
  2. Leave the other variant groups with random sampling
  3. Generate images with sequential artists and random general/elements

Installation

  1. Clone this repository:
  2. Install dependencies:
    pip install -r requirements.txt
    

Usage

  1. Run the application:

    python app.py
    
  2. Access the UI in your browser (typically at http://127.0.0.1:7860)

  3. Enter the following information:

    • API URL and API Key for your image generation service
    • Model name
    • List of artists (one per line)
    • Prompt template with {artist} placeholder and variant options
    • Save location for generated images
    • Number of images to generate
  4. Click "Generate Images" to start the generation process

Example

Artist List:

Vincent van Gogh
Claude Monet
Salvador Dali

Prompt Template:

A painting by {artist}, {landscape|portrait|still life}, {vibrant colors|muted tones|black and white}

This will generate sequential images with:

  1. "A painting by Vincent van Gogh, [random selection], [random selection]"
  2. "A painting by Claude Monet, [random selection], [random selection]"
  3. "A painting by Salvador Dali, [random selection], [random selection]"
  4. "A painting by Vincent van Gogh, [random selection], [random selection]"
  5. And so on...

Notes

To build wheels manually, run the following commands:

python -m pip install build twine
python -m build
twine check dist/*
twine upload dist/*

Metadata

Release files for nai-generate 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nai-generate 0.1.0
File Size Uploaded
nai_generate-0.1.0.tar.gz 77.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nai-generate 0.1.0
File Interpreter ABI Platform
nai_generate-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 91.7 kB

Release files / nai_generate-0.1.0.tar.gz

Download URL nai_generate-0.1.0.tar.gz
Size 77.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dd5cb878d362111fa0fc0da78eda7a6bb406a5aeccd4a676dbef0a3d2c0467f9
BLAKE2b-256 checksum
How to use checksums
1cdb51fba700cbcd6def4e82d0e12857b1f781de55e877623d18763488a85ba1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / nai_generate-0.1.0-py3-none-any.whl

Download URL nai_generate-0.1.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11a506879577c8b6882dcb621a1a516df6539ce02c0fbf783379af777d7ccc36
BLAKE2b-256 checksum
How to use checksums
6b3ba3c2093f498825881bd4d81cbb758265eaa38227e6a0f201246eba7a288f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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