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:
- Replace
{artist}with{@artist1|artist2|artist3}(using the cyclical sampler) - Leave the other variant groups with random sampling
- Generate images with sequential artists and random general/elements
Installation
- Clone this repository:
- Install dependencies:
pip install -r requirements.txt
Usage
-
Run the application:
python app.py -
Access the UI in your browser (typically at http://127.0.0.1:7860)
-
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
-
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:
- "A painting by Vincent van Gogh, [random selection], [random selection]"
- "A painting by Claude Monet, [random selection], [random selection]"
- "A painting by Salvador Dali, [random selection], [random selection]"
- "A painting by Vincent van Gogh, [random selection], [random selection]"
- 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nai_generate-0.1.0.tar.gz | 77.2 kB | Without provenance | Details for nai_generate-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nai_generate-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nai_generate-0.1.0-py3-none-any.whl |
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
|
Security for nai-generate 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.