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/*

Download files

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

Source Distribution

nai_generate-0.1.0.tar.gz (77.2 kB view details)

Uploaded Source

Built Distribution

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

nai_generate-0.1.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file nai_generate-0.1.0.tar.gz.

File metadata

  • Download URL: nai_generate-0.1.0.tar.gz
  • Upload date:
  • Size: 77.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for nai_generate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd5cb878d362111fa0fc0da78eda7a6bb406a5aeccd4a676dbef0a3d2c0467f9
MD5 0f801a5bd62b5bb0b7e4a5e9df72f82f
BLAKE2b-256 1cdb51fba700cbcd6def4e82d0e12857b1f781de55e877623d18763488a85ba1

See more details on using hashes here.

File details

Details for the file nai_generate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nai_generate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for nai_generate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11a506879577c8b6882dcb621a1a516df6539ce02c0fbf783379af777d7ccc36
MD5 019ebccbeb0ba229cb64951654bc77b8
BLAKE2b-256 6b3ba3c2093f498825881bd4d81cbb758265eaa38227e6a0f201246eba7a288f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

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