https://github.com/ototadana/imgflw
A demo application for image editing using LLM
https://github.com/ototadana/imgflw
chatgpt-api chromadb diffusers gradio stable-diffusion
Last synced: 8 months ago
JSON representation
A demo application for image editing using LLM
- Host: GitHub
- URL: https://github.com/ototadana/imgflw
- Owner: ototadana
- License: mit
- Created: 2024-01-03T13:42:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-14T09:39:34.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T23:11:14.972Z (8 months ago)
- Topics: chatgpt-api, chromadb, diffusers, gradio, stable-diffusion
- Language: Python
- Homepage:
- Size: 16.3 MB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# imgflw
A demo application for image editing using LLM.

## imgflw Application Processing Flow
```mermaid
sequenceDiagram
participant User
participant imgflw as User Interface
participant OpenAI_Embed as OpenAI
Embedding API
participant Chroma as Chroma
Vector Store
participant OpenAI_TextGen as OpenAI
Text Generation API
participant FaceEditor as Image Processing
Components
User->>imgflw: 1. Input request
imgflw->>OpenAI_Embed: 2. Convert request to embedding
OpenAI_Embed->>imgflw:
imgflw->>Chroma: 3. Search in Chroma
alt Similar request exists in Chroma
Chroma-->>imgflw: 4a. Retrieve corresponding workflow definition (JSON)
else No similar request in Chroma
imgflw->>OpenAI_TextGen: 4b. Generate new workflow definition (JSON)
end
imgflw->>FaceEditor: 5. Process image using workflow definition
```
- [OpenAPI Schema Specification for Workflow](./imgflw/components/core/workflow_generators/workflow.yml)
## Installation and Launch
Clone this repository:
```bash
git clone https://github.com/ototadana/imgflw
cd imgflw
```
Install [PyTorch 2.1](https://pytorch.org/) and [xFormers](https://github.com/facebookresearch/xformers):
Example command:
```bash
pip install torch torchvision xformers --index-url https://download.pytorch.org/whl/cu121
```
Install required software:
```bash
pip install -r requirements.txt
```
To launch the application:
```bash
python main.py
```
## Initial Setup
Once the interface appears in the browser, switch to the "Settings" tab. Enter your API key in "Workflow Generator - OpenAI API Key" and click "Save".

## Editing Images
1. Upload the image you want to edit.

2. Describe how you want to edit the image in "Input your request here:" and click "Edit".

## License
This software is released under the MIT License, see [LICENSE](./LICENSE).
## Acknowledgements
This application has been developed with the support of several outstanding software resources:
#### Workflow Definition Generation
- [OpenAI Text generation API](https://platform.openai.com/docs/guides/text-generation/text-generation-models)
#### Workflow Definition Storage
- [OpenAI Embeddings API](https://platform.openai.com/docs/guides/embeddings/embeddings)
- [Chroma](https://docs.trychroma.com/)
#### Image Processing
- [Face Editor](https://github.com/ototadana/sd-face-editor)
- [Diffusers](https://huggingface.co/docs/diffusers/index)
- [facexlib](https://github.com/xinntao/facexlib)
- [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN)
- [OpenCV](https://opencv.org/)
- [Pillow](https://python-pillow.org/)
#### User Interface
- [Gradio](https://www.gradio.app/)