AI-powered batch image generation interface using Google Gemini for prompt engineering and RunningHub's FLUX.1-dev LoRA pipeline.
A self-hosted SvelteKit web application that automates high-quality image generation. It uses Google Gemini to craft diverse, scenario-driven prompts from a subject description, then submits them to RunningHub for FLUX.1-dev LoRA-based image synthesis — all through a clean browser UI.
The application runs as a single SvelteKit container with three server-side API routes. The frontend communicates with two external APIs — Google Gemini for prompt generation and RunningHub for image synthesis — while serving generated images from a Docker-mounted volume.
# Clone the repository
git clone <repo-url>
cd rhub
# Ensure the shared Docker network exists
docker network create shared_net 2>/dev/null || true
# Build and start
docker compose up -d
The interface is available on port 3000 within the shared_net Docker network. Use a reverse proxy (e.g., Nginx Proxy Manager) to expose it externally.
npm install
npm run dev
Open http://localhost:5173 in your browser.
| Setting | Where | Description |
|---|---|---|
| Gemini API Key | Web UI | Required. Google Gemini API key for prompt generation |
| RunningHub API Key | Web UI | Required. RunningHub API key for image synthesis |
| LoRA URL | Web UI | URL to a FLUX.1-dev compatible LoRA model |
| Subject | Web UI | Text description of the subject characteristics |
| Aspect Ratio | Web UI | One of: 1:1, 16:9, 9:16, 3:2, 2:3, 4:3, 3:4, 4:5, 5:4 |
| Number of Prompts | Web UI | Batch size (1-50) |
| Output Sub-directory | Web UI | Subdirectory within the mount volume (default: generations) |
| Filename Prefix | Web UI | File naming prefix (default: image) — files are saved as {prefix}_001.png |
| Container Path | Host Path | Purpose |
|---|---|---|
/mount |
./outputs |
Generated images are saved here |
POST /api/generateGenerates a prompt via Gemini and submits an image generation job to RunningHub.
Request Body:
{
"loraUrl": "https://...",
"subject": "Description of the subject",
"aspectRatio": "1:1",
"geminiKey": "...",
"rhubKey": "..."
}
Response:
{
"taskId": "abc123",
"prompt": "Generated FLUX.1-dev prompt text..."
}
POST /api/checkPolls RunningHub for task status and downloads the image on success.
Request Body:
{
"taskId": "abc123",
"rhubKey": "...",
"outputDir": "generations",
"prefix": "image"
}
Response:
{
"status": "SUCCESS",
"filename": "image_001.png"
}
Status values: SUCCESS, PROCESSING, FAILED
GET /api/images/[...path]Serves generated images from the mounted volume. Supports .png and .jpg files with a path traversal security check.
rhub/
├── src/
│ ├── routes/
│ │ ├── +page.svelte # Main UI (form, results, modal)
│ │ ├── +layout.svelte # Root layout
│ │ └── api/
│ │ ├── generate/+server.ts # Gemini prompt gen + RunningHub submit
│ │ ├── check/+server.ts # Task polling + image download
│ │ └── images/[...path]/+server.ts # Static image serving
│ ├── app.html # HTML shell
│ └── app.d.ts # SvelteKit type declarations
├── static/ # Favicons and web manifest
├── Dockerfile # Multi-stage Node.js 20 build
├── docker-compose.yml # Production deployment config
├── svelte.config.js # SvelteKit + adapter-node config
├── vite.config.ts # Vite configuration
└── package.json # Dependencies and scripts
$state, $props)adapter-node@google/generative-ai) — Gemini 3 Pronpm run dev # Start dev server (hot reload)
npm run build # Production build
npm run start # Run production build
npm run preview # Preview production build locally
npm run check # TypeScript and Svelte type checking
git checkout -b feature/my-feature)git commit -m 'Add my feature')git push origin feature/my-feature)Private — All rights reserved.