Skip to content

wildbyteai/promptlens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PromptLens

PromptLens banner

Image-to-prompt Chrome extension for reverse image prompt generation, AI image prompt extraction, and visual marketing diagnosis.

English · 简体中文 · 繁體中文

License Chrome MV3 No backend No build step

PromptLens is a lightweight image-to-prompt Chrome MV3 extension and reverse image prompt generator. It sends a web image or a selected screenshot region to your own OpenAI-compatible Vision API and generates reusable prompts for Midjourney, Stable Diffusion, commercial visual analysis, and visual marketing diagnosis.

Its goal is to stay simple, transparent, and self-hosting-friendly: no login, no payment system, no built-in backend, and no lock-in to a specific model provider.

Features

  • Right-click image analysis: right-click a web image and generate reverse image prompts.
  • Selection screenshot analysis: select a visible page region for blob: images, hotlink-protected images, or remote images without host permission.
  • Bring your own model service: configure AI Base URL, API Key, and Model.
  • OpenAI-compatible Vision API: uses the /chat/completions style vision request format.
  • Structured results: Chinese prompt, English Prompt, Tags, Negative Prompt, JSON Prompt, and Raw JSON.
  • Professional prompt variants: generates recreate, creative extension, and commercial visual prompt cards for professional design workflows.
  • Visual marketing diagnosis: optional business-focused analysis for commercial visuals, with owner-friendly summary, marketing diagnosis, low-cost adaptation brief, and Markdown case export.
  • Built-in output templates: Detailed Analysis, Natural Language, Weighted Tags, and Quick Copy.
  • Custom templates: copy built-ins, create, edit, delete, import, and export custom templates.
  • ChatGPT Plus Assist mode: for users with ChatGPT Plus / Pro but no API key; PromptLens prepares the image and instruction, then can open ChatGPT, wait for the page to settle, and attempt to attach the image and fill the instruction for you to review and send manually.
  • Provider presets: OpenAI, DeepSeek, Alibaba, SiliconFlow, Groq, OpenRouter, Ollama, and Custom.
  • Keyboard selection shortcut: Alt+Shift+S starts screenshot selection; users can change it at chrome://extensions/shortcuts.
  • Optional local history: off by default; stores text results, source domain, original image URL, page URL, and template metadata. No image thumbnails are saved.
  • Result export: copy individual fields, copy all, download JSON, and download Markdown.
  • Local-first: configuration stays in the browser; there is no remote account system.
  • Frontend-only: no npm dependencies, no build step, and no backend service.

Non-goals

PromptLens intentionally does not include:

  • Login / OAuth
  • Payment / quota system
  • Built-in cloud service / Supabase
  • Cloud history sync
  • Auto-fill into third-party generation websites
  • Team collaboration or account sync
  • Advertising account automation, bidding advice, or guaranteed conversion predictions

How it works

  1. The user right-clicks a web image or starts screenshot selection.
  2. The extension reads an image URL, data URL, or current-tab visible screenshot.
  3. The image is validated, cropped, compressed, and normalized to JPEG locally.
  4. The result page calls the user-configured OpenAI-compatible Vision API with the selected template.
  5. The model returns JSON; the result page renders it and provides copy / JSON / Markdown export.

PromptLens has two analysis paths: API Automatic Analysis calls your configured OpenAI-compatible Vision API and renders structured results; ChatGPT Plus Assist mode does not call an API and instead prepares a local JPEG plus a ChatGPT-ready instruction for use on chatgpt.com. The experimental ChatGPT handoff can open ChatGPT, wait for the ChatGPT page to settle, then attempt to attach the image and fill the instruction without automatically sending the message.

PromptLens does not provide a built-in model service. You need your own API service that supports vision input.

PromptLens workflow

Installation

Load from source

  1. Download or clone this repository.
  2. Open Chrome.
  3. Go to chrome://extensions.
  4. Enable Developer mode.
  5. Click Load unpacked.
  6. Select the repository root directory.

Chrome Web Store

Not published yet. A Chrome Web Store link will be added here when available.

Configuration

  1. Open the extension options page from Chrome extension details.
  2. Fill in:
    • AI Base URL: for example https://api.openai.com/v1.
    • API Key: your model service key.
    • Model: a model name that supports vision input.
    • Default output template: Detailed Analysis, Natural Language, Weighted Tags, or Quick Copy.
  3. Click Save settings.
  4. To right-click analyze remote images from any website, click Grant image read permission.

Notes:

  • AI Base URL must use HTTPS.
  • Local development may use http://localhost or http://127.0.0.1.
  • If you do not grant all-sites image read permission, you can still use screenshot selection.

Usage

Analyze a web image

  1. Right-click a web image.
  2. Choose Analyze this image.
  3. A new result tab opens and shows progress.
  4. Copy the prompt you need after analysis completes.

If the page reports missing image read permission, grant permission in options or use screenshot selection.

Analyze a selected screenshot region

  1. Right-click anywhere on a page.
  2. Choose Select screenshot and analyze.
  3. Drag to select the visible region.
  4. Wait for the result page to generate prompts.

Press Esc or click Cancel to exit selection mode.

First Success path

PromptLens v0.6 focuses on helping users complete either an API-based analysis or a no-API-key ChatGPT Plus Assist flow:

  1. Open the options page.
  2. Configure your own OpenAI-compatible Vision API: Provider/Base URL, API Key, and a model that supports image input.
  3. Save settings.
  4. Analyze a page image with the context menu, or use area capture when site permissions or remote image loading get in the way.
  5. Copy a prompt/tags/variants result, or export a Markdown brief from the visual marketing diagnosis template.

PromptLens does not provide a model service, backend, proxy, telemetry, account system, or cloud sharing. Analysis requests are sent from your browser to the Base URL you configure.

Screenshots

Context menu Options
PromptLens context menu PromptLens options page
Result ChatGPT Plus Assist
PromptLens result page PromptLens ChatGPT Plus Assist handoff

Privacy and security

PromptLens has a simple privacy boundary:

  • API Key is stored locally in chrome.storage.local.
  • Images are sent only to the AI Base URL you configure.
  • The extension has no backend service and collects no telemetry.
  • Local history is off by default; when enabled, it stays in the browser, saves source image/page URLs for history recall, and does not save image thumbnails. It may save generated prompt text, including professional prompt variants that describe visible people, brands, products, scenes, or commercial visual details inferred from the image.
  • Remote image read permission is optional and is not requested at install time.
  • Screenshot selection uses activeTab and only accesses the current tab after user action.

Experimental ChatGPT handoff: when you click Try sending to ChatGPT, PromptLens may request optional access to https://chatgpt.com/*. This is used only to open ChatGPT, wait for the page to settle, and attempt to attach the prepared local JPEG and fill the instruction into the ChatGPT page. PromptLens does not automatically send the message, does not read ChatGPT replies, and keeps manual download/copy fallback available if the page cannot accept the image or instruction.

When using a third-party model service, images and prompts are sent to that service. Review the provider's privacy policy, retention policy, and terms yourself.

Professional prompt variants are model-generated text suggestions, not official parameters or guaranteed best practices for any third-party generation platform. When you paste prompts into another tool, that tool's privacy, billing, copyright, and content policies apply.

See SECURITY.md for more details.

Permissions

Permissions used in manifest.json:

  • contextMenus: create right-click menus.
  • storage: store model config, current template, local history settings, and temporary input.
  • activeTab: access the current tab when the user starts screenshot selection.
  • scripting: inject screenshot selection script and style.
  • commands: register the screenshot selection shortcut.
  • optional_host_permissions: ["<all_urls>"]: request remote image read permission and API origin access only when needed.

Supported image formats

  • Supported: PNG, JPEG, WebP.
  • Not supported: SVG.
  • Not directly readable: blob: images. Use screenshot selection instead.
  • Remote image file size limit: 20MB.
  • Images are normalized to JPEG before sending to the model.

Development

This project intentionally stays simple:

manifest.json      Chrome MV3 manifest
background.js      Context menus, screenshot capture, temporary payload handoff
content.js         In-page screenshot selection interaction
selection.css      Screenshot selection styles injected into web pages
options.html/js    Options page
history-store.js   Local history IndexedDB helper
history.html/js    Local history page
templates.js       Built-in / custom templates and fixed JSON output schema
result.html/js     Result page, export, history save, and model calls
styles.css         Options and result page styles

Local checks:

node --check background.js
node --check content.js
node --check templates.js
node --check history-store.js
node --check history.js
node --check options.js
node --check result.js

Development principles:

  • No build tools.
  • No npm dependencies.
  • No remote resources.
  • Keep Vanilla JavaScript / CSS.
  • Keep new features local-first and privacy-transparent.

Roadmap status

The current branch has implemented v0.6.0: First Success onboarding, clearer provider setup guidance, contextual result next steps, marketing context examples, visual marketing diagnosis, Warm Studio UI refresh, summarized history cards, built-in / custom templates, provider presets, keyboard shortcut, result export, token usage, optional local history, basic i18n, Chrome Web Store preparation, ChatGPT Plus Assist mode for no-API-key workflows, and experimental ChatGPT handoff that can open ChatGPT, wait for the page to settle, and attempt to attach the prepared image and fill the instruction after optional user permission.

Future feedback-driven directions:

  • More complete English / Traditional Chinese UI translation.
  • Firefox MV3 compatibility research.
  • Continue tuning image preprocessing defaults based on real feedback.

Contributing

Issues and pull requests are welcome. Please read CONTRIBUTING.md first.

License

MIT License. See LICENSE.

About

Local-first Chrome extension for reverse-engineering image prompts and visual marketing diagnosis with your own Vision API.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages