Skip to content

Art Style Fusion Prompt Engineering is a Gradio app that blends art styles, descriptions, and artist recommendations into prompts for T5 text encoders (Tested Heavily with Flux)

License

Notifications You must be signed in to change notification settings

ergonomech/Art-Style-Fusion-Prompt-Enginner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Art Style Fusion Prompt Engineering

Header

Overview

Art Style Fusion Prompt Engineering is a versatile Gradio-based application that allows users to create rich, detailed prompts by combining various art styles, image descriptions, and artist inspirations. It is particularly useful for artists, writers, and AI enthusiasts looking to generate creative content with detailed prompts suitable for text to image generators that use T5 text encoders such as Flux but can further convert prompts into Adobe and Stable Diffusion-compatible (SDXL) format.

It uses OpenAI or OpenRouter (or a mix of both) to access both text and image-based AI models, providing a seamless experience for generating prompts. OpenRouter allows for more uncensored and experimental prompts, while OpenAI provides a more controlled and curated experience with a better vision model.

Futher adaptations will be made to use Claude and Ollama but this was so sucessful and cost effective that it was decided to keep it as is for now.

Installation

You can install the required dependencies using either pip or conda.

Using pip and Python Virtual Environment

  1. Clone the repository:

    git clone https://github.com/ergonomech/Art-Style-Fusion-Prompt-Enginner.git
    cd Art-Style-Fusion-Prompt-Engineering
  2. Create a virtual environment:

    python -m venv env
  3. Activate the virtual environment:

    • On Windows:
      .\env\Scripts\activate
    • On macOS and Linux:
      source env/bin/activate
  4. Install the required packages:

    pip install gradio requests pillow python-dotenv

Using Conda (recommnended)

  1. Make sure you have Conda installed. If not, you can download it from here.

  2. Clone the repository:

    git clone https://github.com/ergonomech/Art-Style-Fusion-Prompt-Enginner.git
    cd Art-Style-Fusion-Prompt-Engineering
  3. Create a new Conda environment and install dependencies:

    conda create --name art-style-fusion python=3.10 requests pillow python-dotenv conda-forge::gradio
    conda activate art-style-fusion

Usage

  1. Make sure you have the necessary API keys and configuration details. Update the .env file with your OpenAI and OpenRouter API keys. These variables can also be loaded from your operating system environment variables as priority.

  2. Start the application by running:

    python gradio-app.py
  3. Open your web browser and navigate to the URL provided (default is http://127.0.0.1:7633).

  4. Use the UI to configure your inputs, upload images, select art styles, and generate prompts.

Features

  • Art Style Selection: Choose from a variety of art styles and get detailed descriptions. Art Style Selection

  • Image Analysis: Upload an image or input a description to get a detailed analysis. Image Analysis

  • Artist Recommendation: Get suggestions for artists whose style matches the chosen art and image elements. Artist Recommendation

  • Prompt Generation: Combine the selected style, image description, and artist suggestion into a cohesive prompt. Prompt Generation Prompt Generation Result ComfyUI

  • Stable Diffusion Conversion: Convert prompts into Stable Diffusion-compatible format for further use. Stable Diffusion Prompt Stable Diffusion Prompt

Credits

  • Gradio: Provides the interface for this application. Learn more at Gradio's official site.
  • PIL (Pillow): Used for image processing. Learn more at Pillow's official site.
  • requests: Handles API calls to OpenAI and OpenRouter.
  • dotenv: Manages environment variables for flexible configuration.

Contributing

Feel free to contribute to this project by opening issues or submitting pull requests. All contributions are welcome!

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Art Style Fusion Prompt Engineering is a Gradio app that blends art styles, descriptions, and artist recommendations into prompts for T5 text encoders (Tested Heavily with Flux)

Topics

Resources

License

Stars

Watchers

Forks

Languages