← back to SERVICE

Photoshop NovelAI Plugin

A Photoshop panel that generates, inpaints, and outpaints images with NovelAI, so generative edits happen without leaving Photoshop.

stack
Adobe UXP, JavaScript, NovelAI Image API, Gemini API, fflate
What I did
  • Built the UXP panel for generation, inpainting, outpainting, and Focused Inpaint.
  • Wrote the image processing the UXP runtime lacks, including a PNG encoder that keeps mask edges sharp.
  • Added an optional Gemini step that turns a Korean edit request into an English prompt and a suggested strength.
What the team did
  • A colleague recommended NovelAI as the generation engine.

What it is

A Photoshop panel (UXP plugin, Photoshop 24 or later) that calls the NovelAI image API from inside Photoshop. It does four things:

  • Generate: Create a new image from a prompt.
  • Inpaint: Redraw only the selected area. The Photoshop selection is the mask.
  • Outpaint: Extend the canvas, select the empty area, and fill it. This runs through inpainting, with no separate API.
  • Focused Inpaint: In a large document, crop the selection plus a margin, process it at a suitable resolution, and composite the result back in place.

Every result lands on a new layer at the original position and size, so the original is never touched.

Why I built it

When an image in Photoshop needed a generative edit, it had to be exported, edited in an outside tool such as ChatGPT, and brought back. Every revision repeated that round trip. The plugin removes four steps: export, upload, download, and re-import.

NovelAI was chosen because it focuses on 2D illustration styles, so edited areas blend with webtoon art, and it offers a separate inpainting model.

How it works

  • The plugin does not draw. NovelAI generates the pixels. The plugin reads the document, builds the mask and the request, and places the result.
  • Inpainting quality depends on what you send. Empty areas are filled by spreading nearby pixels, so the model does not read blank white or black as content. Padding added to meet the API’s size rule is also marked as area to generate, which prevents stripe artifacts.
  • Filling gaps in the runtime. UXP’s built-in encoder outputs only JPEG, which blurs mask edges. The plugin includes its own PNG encoder, zip extraction, and base64 conversion. These functions are kept separate from Photoshop and tested with Node.
  • Photoshop stays responsive. The document is locked only while pixels are read or layers are placed, not while waiting for the API.
  • Clear errors and costs. Server errors and dropped connections are retried up to two times. Other errors are shown as plain messages. The panel warns before a request size that uses paid credits.
  • Optional prompt enhancer. Type an edit request in Korean, for example “remove only the glasses”. Gemini returns a structured suggestion: what to keep, remove, and add, an English prompt, and a recommended strength. The user reviews it and presses Apply. Nothing runs automatically.
  • Secrets stay local. Tokens and keys are kept in UXP secure storage, and the manifest allows network access to only two domains.