A lightweight, modern image generation prompt management tool. Store, organize, search, and reuse your AI image generation prompts with a clean, intuitive interface.
- Simple & Focused - Just prompts and tags. No unnecessary fields.
- Full-text Search - Search through prompt text and tags instantly.
- Tag Organization - Add custom tags to categorize your prompts.
- One-Click Copy - Copy any prompt to clipboard with a single click.
- Random Shuffle - Instantly shuffle the order of displayed prompts to discover new combinations.
- Infinite Scroll - Smooth lazy loading - all prompts on one page, no pagination.
- Bulk Operations - Select, delete, and manage multiple prompts.
- Import/Export - Backup your prompts as JSON or import from another instance.
- Soft Delete - Safely delete prompts with 30-day cleanup cycle.
- Auto-Generated Titles - Titles auto-fill from prompt text (editable).
- Refactor Mode - Duplicate a prompt and immediately start editing.
- Responsive Design - Works on desktop and mobile.
- Keyboard Shortcuts - Navigate efficiently with keyboard shortcuts.
- Image Cards - Attach images to prompts and display them as beautiful cards with hover overlays.
- Dark Mode - Toggle between light and dark themes (persisted automatically). Search bar glows black in night mode.
- Usage Tracking - Automatically tracks how many times each prompt is used.
- Image Upload - Upload and attach images directly from the create/edit modal.
- AI Image Generation - Generate images directly from prompts using ComfyUI integration (requires external ComfyUI server).
- Uses 8 diffusion steps for higher quality output
- Random seed generated for each image to ensure variety
- Auto-save before generation - Generate works immediately on new or refactored prompts
- Queue multiple generations (no need to wait for previous to finish)
- Remove images with auto-save to enable immediate generation
- Node.js 12+ (tested on 12.22.9)
- npm
# Clone or extract the project
cd prompt-stack
# Install dependencies
npm install
# Start the server
npm startThe application will be available at: http://localhost:11800
- Click "+ New Prompt" button
- Enter your prompt text in the "Prompt" field
- The title auto-fills from the first 60 characters (editable)
- Optionally add tags (comma-separated)
- Click Save
| Action | How to |
|---|---|
| Copy to clipboard | Click 📋 on any card (provides visual feedback on success) |
| Edit | Click |
| Refactor / Duplicate | Click ✏️ to copy and immediately edit |
| Delete | Click 🗑️ on any card (with confirmation) |
Note: The copy feature uses the modern Clipboard API with fallback support for all browsers and contexts.
- Search box: Type to search prompt text and tags (real-time)
- Tag cloud: Click any tag to filter by that tag
- Sort: Newest, Oldest, or Most Used
- Include deleted: Checkbox to show soft-deleted prompts
- Export: Downloads all prompts as JSON
- Import: Upload a JSON file to add prompts (skips duplicates)
- Cleanup: Permanently delete prompts marked as deleted >30 days ago
The app can generate images using a ComfyUI server:
- Set up ComfyUI: Run a ComfyUI instance (default:
http://127.0.0.1:11820) - Configure the URL: Set
COMFYUI_URLenvironment variable if not using default - Prepare the workflow: The app uses
image_z_image_turbo-prompt.jsonworkflow template- Node 67: Prompt text input (auto-populated from your prompt)
- Node 69: KSampler with 8 diffusion steps (auto-random seed)
- Generate: Click the "✨ Generate Image" button in any prompt modal
- New prompts: Auto-saves first, then generates
- Existing prompts: Generates immediately
- The workflow is sent to ComfyUI
- App polls for completion (up to 5 minutes)
- Generated image downloads and attaches to the prompt
- Image appears as a background card in the grid
- Multiple generations: You can queue multiple prompts; they generate concurrently
Smart features:
- Refactor clears image: When you duplicate/refactor a prompt, the image is NOT copied, so you can generate a fresh variation immediately
- Remove & regenerate: Click "Remove Image" to delete the current image (auto-saves), then generate a new one right away
- Auto-save before generate: Works on unsaved prompts - no manual save needed
Requirements:
- ComfyUI must be running and accessible
- Workflow file must exist at
server/image_z_image_turbo-prompt.json - The workflow should use standard ComfyUI node IDs as expected by the code
Click the 🎲 Random button to instantly shuffle the order of all currently displayed prompts. This helps you discover prompts in a new context and see your collection from a different perspective. The shuffle respects all current filters (search, tags, sort). Cards snap into their new positions with a smooth layout.
Instead of pagination, the app uses lazy loading - prompts load automatically as you scroll down. This gives you a seamless, single-page experience with all your prompts visible in one continuous grid. The app fetches 30 prompts per batch and continues loading until all are displayed.
| Shortcut | Action |
|---|---|
Ctrl/Cmd + N |
Create new prompt |
/ |
Focus search box |
Esc |
Close modal |
Each prompt stores:
title- Auto-generated from prompt (editable)prompt- The actual prompt texttags- Array of tag strings for organizationimage- Filename of associated image (uploaded or generated, stored in/imagesdirectory)usage_count- How many times the prompt has been used (copy, edit, refactor)created_at/updated_at- Timestampsdeleted_at- Null if not deleted (soft delete)
Notes:
model_typeis no longer used (set to "Other" automatically)descriptionfield is deprecated
Prompts with attached images are displayed as cards with image backgrounds:
- Image fills the card with a 16:9 aspect ratio (similar to video thumbnails)
- Title is hidden to emphasize the visual
- On hover: the prompt text appears as a semi-transparent overlay at the bottom
- Tags and metadata appear as overlays with blur effects
- Click anywhere on the card to open the full edit modal
Image cards work best with 1280x720 or similar 16:9 ratio images. The images are automatically resized and cropped to fit using object-fit: cover.
Toggle dark mode with the 🌙/☀️ button in the header. Your preference is saved to localStorage and persists across sessions. On first visit, the app respects your system's color scheme preference.
The usage count (shown as "X uses" on each card) automatically increments when you:
- Copy a prompt (📋)
- Click a card to open it
- Click the edit button (
↔️ ) - Click the refactor button (✏️)
This helps you identify your most-used prompts at a glance.
All endpoints under /api/
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/prompts |
List prompts (search, filter, paginate) |
GET |
/api/prompts/:id |
Get single prompt |
POST |
/api/prompts |
Create prompt |
PUT |
/api/prompts/:id |
Update prompt |
DELETE |
/api/prompts/:id |
Soft delete |
PATCH |
/api/prompts/:id/increment-usage |
Increment usage count |
POST |
/api/prompts/:id/duplicate |
Duplicate prompt |
POST |
/api/prompts/bulk-delete |
Bulk delete (body: {ids: []}) |
GET |
/api/prompts/random |
Get random prompt |
POST |
/api/prompts/:id/generate-image |
Generate image using ComfyUI (requires COMFYUI_URL env var) |
Query parameters for /api/prompts:
search- Text search across prompt and tagspage- Page number (default: 1) - used by frontend for infinite scrolllimit- Items per page (default: 20) - frontend uses 30 for batch loadingsort-newest(default),oldest,most_usedinclude_deleted-trueorfalse(default)tags- Comma-separated tag filter
Note on Pagination: The frontend UI uses infinite scroll (auto-loading) instead of traditional pagination buttons, but the backend pagination parameters remain for API compatibility and to enable lazy loading.
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/tags |
List all tags with usage counts |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/export |
Export all prompts as JSON |
POST |
/api/import |
Import prompts (body: {prompts: []}) |
POST |
/api/cleanup |
Delete old deleted prompts (>30 days) |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/upload |
Upload an image (multipart/form-data, field name: image) |
- Node.js - Runtime
- Express.js - Web framework
- SQLite (better-sqlite3) - Database
- WAL mode - Write-Ahead Logging for concurrency
- Vanilla JavaScript (ES5) - No frameworks, maximum compatibility
- CSS3 - Modern styling with CSS variables
- HTML5 - Semantic markup
- Fetch API - RESTful communication
- Single-page application (SPA)
- REST API with comprehensive error handling
- Server-side static file serving
- Soft delete with scheduled cleanup
prompt-stack/
├── server/
│ ├── index.js # Express server entry point
│ ├── database/
│ │ ├── connection.js # DB connection & init
│ │ └── schema.sql # Database schema
│ ├── routes/
│ │ ├── prompts.js # Prompt CRUD & operations (includes ComfyUI integration)
│ │ ├── tags.js # Tag endpoints
│ │ ├── upload.js # Image upload endpoint
│ │ └── importExport.js # Import/export/cleanup
│ ├── middleware/
│ │ └── errorHandler.js # Error handling middleware
│ └── image_z_image_turbo-prompt.json # ComfyUI workflow template for image generation
├── public/
│ ├── index.html # Main HTML
│ ├── css/
│ │ └── style.css # All styles
│ └── js/
│ └── app.js # Frontend application
├── images/ # Uploaded image files (auto-created dir)
├── uploads/ # (deprecated, use /images)
├── prompts.db # SQLite database (auto-created)
├── package.json
└── README.md
# List prompts (initially empty)
curl http://localhost:11800/api/prompts
# Create a prompt
curl -X POST http://localhost:11800/api/prompts \
-H "Content-Type: application/json" \
-d '{"title":"Test","prompt":"A beautiful sunset over mountains"}'
# Get random prompt
curl http://localhost:11800/api/prompts/randomcurl -X POST http://localhost:11800/api/import \
-H "Content-Type: application/json" \
-d @prompts.jsonCreate a .env file:
| Variable | Default | Description |
|---|---|---|
PORT |
11800 | Server port |
DATABASE_PATH |
./prompts.db |
SQLite database location |
CLEANUP_DAYS |
30 | Days before permanently deleting soft-deleted prompts |
COMFYUI_URL |
http://127.0.0.1:11820 |
ComfyUI server URL for image generation |
On first run, the schema.sql file automatically creates the prompts table with appropriate indexes.
The database is initialized with WAL (Write-Ahead Logging) mode for better performance and concurrency.
If you're upgrading from an earlier version that lacks the image column:
sqlite3 prompts.db "ALTER TABLE prompts ADD COLUMN image TEXT;"This adds support for image attachments on prompts. The images themselves are stored in the /images directory (not in the database).
This indicates a corrupted SQLite database. Fix:
rm prompts.db-wal prompts.db-shm # Remove WAL files
npm start# Kill existing node processes
pkill -f "node server/index.js"
npm start- Hard refresh browser:
Ctrl+Shift+R(orCmd+Shift+R) - Check browser console for errors (F12)
- Verify API returns data:
curl http://localhost:11800/api/prompts
Make sure you're not loading an old cached version. Clear browser cache or use incognito mode.
Error: "Failed to generate image" or timeout
- Verify ComfyUI is running: Visit
http://127.0.0.1:11820in your browser - Check the
COMFYUI_URLenvironment variable matches your ComfyUI instance - Ensure the workflow file
server/image_z_image_turbo-prompt.jsonexists and is valid - Check that ComfyUI's output directory is writable (images are saved there before download)
- Check server logs for detailed error messages
- Ensure ComfyUI is not blocked by CORS (the app uses server-side proxy, so CORS shouldn't be an issue)
MIT
Built with ❤️ for prompt engineers and AI artists.