A small Tkinter GUI that batches images through the OpenAI API with a shared prompt, then saves one text output per image. Designed for turning image OCR content into structured text (for example, HTML pages) while keeping folder structure and running in parallel.
一个基于 Tkinter 的小型图形界面工具,使用同一条提示词批量处理图片,并为 每张图片生成一个文本输出文件。适合把图片/OCR 内容转成结构化文本(例如 HTML 页面),同时保留目录结构并支持并发处理。
-
Batch process images in a folder (optionally including subfolders).
-
Filter by file extension (default:
.png). -
Skip existing outputs to avoid rework.
-
Parallel mode with configurable concurrency.
-
Prompt loaded from
Prompt.txtand saved inconfig.txt. -
Output mirrors input folder structure under the chosen output base.
-
批量处理文件夹内图片(可包含子目录)。
-
按后缀过滤(默认
.png)。 -
可跳过已生成的输出,避免重复处理。
-
并发模式,可设置并发数。
-
启动时读取
Prompt.txt,配置保存到config.txt。 -
输出目录保持与输入相同的相对结构。
- Python 3.9+(推荐 3.10+)
openaiPython SDK(v1)- Tkinter(Windows 上通常自带)
Install dependencies / 安装依赖:
pip install -U openaiRun the GUI / 启动界面:
python image_prompt_runner.pyIn the app / 在界面中:
- Choose a root folder containing images. / 选择图片根目录。
- Set model, temperature, and max tokens. / 设置模型、温度和最大输出。
- Paste your prompt or use
Prompt.txt. / 粘贴提示词或使用Prompt.txt。 - Set output base (default:
outputs). / 设置输出根目录(默认outputs)。 - Click "Start" (single-thread) or "Parallel". / 点击开始或并发处理。
Outputs are saved as .txt files with the same base name as the image and the
same relative folder structure.
输出为 .txt 文件,文件名与图片一致,并保留相对目录结构。
-
config.txtis read on startup and saved by the GUI. -
Prompt.txt(if present) loads the prompt area on startup. -
启动时读取
config.txt,也可在界面中保存配置。 -
若存在
Prompt.txt,启动时会自动加载到提示词输入框。
config.txt stores OPENAI_API_KEY in plain text for convenience. Do not
commit it to public repos. Remove the key or add config.txt to .gitignore
before publishing.
密钥或将 config.txt 加入 .gitignore。
-
If you see 429 rate limit errors, the tool retries with backoff.
-
The model is configurable; ensure it supports image input.
-
Output is plain text, one file per image.
-
出现 429 限速时会自动重试并退避等待。
-
模型可配置,请确保支持图像输入。
-
输出为纯文本,每张图对应一个文件。