tui: prompt enhancement & tag generation AI jobs #26

Closed
opened 2026-04-11 13:03:52 +00:00 by charles · 0 comments
Owner

User story

As a user writing prompts, I want one-key shortcuts to enhance a prompt with an LLM or auto-generate tags from the current init image, so that I can iterate faster and get better results.

Acceptance criteria

Prompt enhancement (Ctrl+E)

  • From the Generate screen invokes loom-core::AiJobWorker::enhance_prompt(current_prompt) using the Ollama or Claude Code plugin configured under Settings → AI Features
  • Status-bar spinner is shown while the job is in flight
  • Result either replaces the current prompt or is appended, controlled by a setting prompt_enhancement_mode = replace | append
  • Failures surface via the notification bar with the backend error message; the original prompt is preserved

Tag generation (Ctrl+T)

  • Requires an init image (i2i/inpaint/controlnet modes); otherwise shows "no init image" notification
  • Calls the AI tag-generation backend with the image path; appends the returned comma-separated tags to the prompt
  • Deduplicates tags against the existing prompt

Plumbing

  • Both actions are registered with the command palette (generate.enhance_prompt, generate.generate_tags)
  • Both honour KeyMap overrides from the keybinds system
  • A single AiJobHandle at a time on the Generate screen; second-trigger while one is running shows "AI job already running" notification

Tests

  • Unit test: a mock AiJobWorker returning "enhanced" replaces the prompt when mode = replace
  • Unit test: tag generation deduplicates against existing prompt tokens

Out of scope

  • Defect / region analysis in Gallery (separate ticket)
  • Entity description / face detection (Entity screen ticket)

References

  • Spec §4.1.2 "Prompt enhancement", "Tag generation"
  • Spec §6 "AI-Assisted Workflow"
## User story As a user writing prompts, I want one-key shortcuts to enhance a prompt with an LLM or auto-generate tags from the current init image, so that I can iterate faster and get better results. ## Acceptance criteria ### Prompt enhancement (`Ctrl+E`) - [ ] From the Generate screen invokes `loom-core::AiJobWorker::enhance_prompt(current_prompt)` using the Ollama or Claude Code plugin configured under Settings → AI Features - [ ] Status-bar spinner is shown while the job is in flight - [ ] Result either replaces the current prompt or is appended, controlled by a setting `prompt_enhancement_mode = replace | append` - [ ] Failures surface via the notification bar with the backend error message; the original prompt is preserved ### Tag generation (`Ctrl+T`) - [ ] Requires an init image (i2i/inpaint/controlnet modes); otherwise shows "no init image" notification - [ ] Calls the AI tag-generation backend with the image path; appends the returned comma-separated tags to the prompt - [ ] Deduplicates tags against the existing prompt ### Plumbing - [ ] Both actions are registered with the command palette (`generate.enhance_prompt`, `generate.generate_tags`) - [ ] Both honour `KeyMap` overrides from the keybinds system - [ ] A single `AiJobHandle` at a time on the Generate screen; second-trigger while one is running shows "AI job already running" notification ### Tests - [ ] Unit test: a mock AiJobWorker returning "enhanced" replaces the prompt when mode = replace - [ ] Unit test: tag generation deduplicates against existing prompt tokens ## Out of scope - Defect / region analysis in Gallery (separate ticket) - Entity description / face detection (Entity screen ticket) ## References - Spec §4.1.2 "Prompt enhancement", "Tag generation" - Spec §6 "AI-Assisted Workflow"
charles added this to the loom-tui v0.1.0 milestone 2026-04-11 13:03:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom#26
No description provided.