Skip to content

Repository files navigation

Image-to-Prompt Tool

AI-powered image-to-prompt desktop tool. Convert images into structured, reusable prompts for AI image generation.

Python 3.10+ License: MIT Platform: Windows

English | 中文

Screenshot

Screenshot

Features

  • Multi-language Prompts - Chinese, English, Japanese detailed prompts
  • Structured Output - Negative prompts, style tags, JSON-structured prompts
  • Drag & Drop - Drag images directly into the app
  • Clipboard Support - Ctrl+V paste from clipboard
  • History - Auto-save analysis results with thumbnails
  • Retry Logic - Automatic API retry on failure (800ms/1800ms)
  • Dark Theme - Modern Tokyo Night inspired UI
  • One-click Copy - Copy any prompt type with a single click

Quick Start

Option 1: Download Release (No Python Required)

  1. Download the latest release from Releases
  2. Extract the zip file
  3. Run ImageToPrompt-v3.exe

Note: If you get a DLL error, install Visual C++ Redistributable 2015-2022

Option 2: Run from Source

# Clone the repository
git clone https://github.com/yourusername/image-to-prompt.git
cd image-to-prompt

# Install dependencies
pip install -r requirements.txt

# Run
python main.py

Option 3: Build Your Own EXE

# Install PyInstaller
pip install pyinstaller

# Build
pyinstaller build.spec

# Output: dist/ImageToPrompt-v3/

Configuration

  1. Launch the app
  2. Enter your API settings in the config dialog:
    • Base URL: Your OpenAI-compatible vision endpoint (e.g., http://127.0.0.1:8080/v1)
    • API Key: Your API key
    • Model: Your vision model name (e.g., gpt-4o)
  3. Click "Test Connection" to verify
  4. Click "Save"

Usage

Action How
Select image Click the drop zone to browse files
Drag image Drag from file explorer to the drop zone
Paste image Ctrl+V from clipboard
View history Click any item in the history list
Retry failed Double-click a failed entry
Cancel analysis Click the Cancel button
Copy prompt Click the Copy button on any tab

Output Types

Tab Description
中文 Detailed Chinese prompt (150+ characters)
English Detailed English prompt (150+ words)
日本語 Detailed Japanese prompt (150+ words)
Core Concise English prompt (80-120 words)
Recreation Complete English prompt (200+ words)
Negative Negative prompt for avoiding artifacts
Tags Style tags in 3 languages
JSON Structured prompt breakdown

Tech Stack

  • Python 3.10+
  • PyQt5 - UI framework
  • requests - HTTP client
  • PyInstaller - Packaging

Project Structure

image-to-prompt/
├── main.py                  # Entry point
├── requirements.txt         # Dependencies
├── build.spec               # PyInstaller config
├── prompt_card/
│   ├── config.py            # Config management
│   ├── api_client.py        # Vision API client
│   ├── api_worker.py        # Async API worker
│   ├── history.py           # History storage
│   └── ui/
│       ├── main_window.py   # Main window
│       ├── config_dialog.py # Config dialog
│       ├── image_drop.py    # Image drop zone
│       ├── prompt_panel.py  # Prompt result panel
│       └── styles.py        # Dark theme styles
└── tests/
    └── ...

License

MIT License - See LICENSE for details.


中文说明

功能介绍

AI 驱动的图片反推提示词工具。支持将网页图片、本地图片转换为可复用的结构化 Prompt。

  • 中文/英文/日文详细提示词
  • 负面提示词、风格标签、JSON 结构化 Prompt
  • 拖拽/选择/粘贴图片
  • 历史记录自动保存
  • API 自动重试
  • 暗色主题
  • 一键复制

快速开始

方式一:下载发行版(无需 Python)

  1. Releases 下载最新版本
  2. 解压 zip 文件
  3. 运行 ImageToPrompt-v3.exe

注意: 如果启动报错 DLL 缺失,请安装 Visual C++ Redistributable 2015-2022

方式二:从源码运行

git clone https://github.com/yourusername/image-to-prompt.git
cd image-to-prompt
pip install -r requirements.txt
python main.py

配置说明

  1. 启动程序
  2. 在配置窗口填写:
    • Base URL:你的视觉模型 API 地址
    • API Key:你的 API 密钥
    • Model:模型名称
  3. 点击"Test Connection"测试连接
  4. 点击"Save"保存

使用方法

操作 方式
选择图片 点击左侧区域浏览文件
拖拽图片 从文件管理器拖入
粘贴图片 Ctrl+V
查看历史 点击历史列表项
重试失败 双击失败条目
取消分析 点击 Cancel 按钮
复制 Prompt 点击 Copy 按钮

许可证

MIT 许可证 - 详见 LICENSE

About

AI-powered image-to-prompt desktop tool. Convert images into structured prompts for AI image generation.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages