Precision Art Studio is a small full-stack web app for AI-assisted image generation and editing.
It includes:
- text-to-image generation
- targeted image editing with a drag-to-select region
- add-to-image / outpainting by expanding the canvas
- style transfer / restyling
- custom dimensions for generation
- local tone controls for saturation and warmth
- render history and download support
- Node.js
- Express
- Sharp
- plain HTML, CSS, and JavaScript
The frontend is a single-page studio in public/index.html.
The backend in server.js exposes:
GET /api/status- basic health and API-key statusPOST /api/generate- prompt-to-image generationPOST /api/edit- edit, restyle, and outpaint flowsPOST /api/tone- local PNG tone adjustment for warmth and saturation
For model-backed image generation and edits, the server expects an OpenAI API key and uses the image API through a secure backend proxy so the key is never exposed in the browser.
-
Install dependencies:
npm install
-
Copy the environment template:
cp .env.example .env
-
Add your API key to
.env:OPENAI_API_KEY=your_key_here
Optional:
OPENAI_IMAGE_MODEL=gpt-image-2 PORT=3000
-
Start the app:
npm start
-
Open:
http://localhost:3000
Run with file watching:
npm run devRun tests:
npm testThis repo now includes a render.yaml Blueprint and a production Dockerfile.
Steps:
- Push the repo to GitHub.
- In Render, create a new Blueprint using this repository.
- When prompted, set:
OPENAI_API_KEY
- Deploy.
Render will:
- build from
Dockerfile - start the app with
npm start - use
GET /healthfor health checks
Build:
docker build -t precision-art-studio .Run:
docker run --rm -p 3000:3000 \
-e PORT=3000 \
-e OPENAI_API_KEY=your_key_here \
precision-art-studioThen open:
http://localhost:3000
- Enter a prompt
- Choose a style preset and quality
- Use either automatic sizing or a custom width and height
- Upload a source image
- Switch to Edit
- Drag a box over the visible image area
- Describe exactly what should change
- Upload a source image
- Switch to Add to image
- Increase the expansion values on the sides you want to extend
- Describe what should fill the new space
- Upload a source image
- Switch to Style transfer
- Pick a style preset and optionally add style notes
The tone controls work locally through Sharp and produce a new PNG without requiring a model call. This is useful for quick finishing adjustments after generation or editing.
Flexible sizes are validated with the following constraints:
- minimum edge: 256px
- both dimensions must be multiples of 16
- maximum edge: 3840px
- maximum aspect ratio: 3:1
- total pixels must stay within the configured supported range
Generated images can use flexible dimensions. Edit and restyle flows stay anchored to the source image dimensions, while outpainting expands the image and keeps the result aligned to the expanded canvas.
.
├── lib/
│ └── image-utils.js
├── public/
│ └── index.html
├── test/
│ ├── image-utils.test.js
│ └── server.test.js
├── .env.example
├── .gitignore
├── package.json
└── server.js
- The app works without an API key for local tone adjustment and interface testing, but generation and model-backed editing require
OPENAI_API_KEY. - The browser UI is intentionally framework-free to keep the project easy to inspect and deploy.
- A lightweight
GET /healthendpoint is included for production health checks.