Advanced image generation control center. Features AI-orchestrated prompt engineering from 300 photogenic locations, multi-model generation (FLUX.1-dev via RunningHub, Z-Image via RunPod Serverless, and FLUX.2-klein via RunPod Serverless), multi-LoRA additive blending, sequential batch queuing, image upscaling with LSB steganography support, and real-time polling.
rhub is a specialized SvelteKit-based dashboard that transforms simple subject descriptions into high-quality, LoRA-consistent imagery. It solves the "repetition problem" in AI generation by bridging expert prompt engineering (Gemini/Qwen) with multiple synthesis pipelines.
.env and are automatically used as defaults. UI fields override them on a per-session basis.The application runs as a single SvelteKit container. API routes handle server-side logic including AI prompt synthesis, S3 uploads, RunningHub interaction, and direct RunPod Serverless calls. Images are served directly from a Docker-mounted volume to prevent caching issues and ensure persistence.
/api/check for status, downloads the result, and optionally decodes hidden data./run) using the new multi-LoRA loras array./api/zimage-check until the job completes, then downloads the JPG from the S3 URL returned by RunPod./run)./api/zimage-check until the job completes, then downloads the JPEG from the S3 presigned URL returned by RunPod.# Clone the repository
git clone <repo-url>
cd rhub
# Configure environment variables
cp .env.example .env
# Edit .env with your API keys, S3 credentials, and RunPod endpoints
# Ensure the shared Docker network exists
docker network create shared_net 2>/dev/null || true
# Build and start
docker compose up -d --build
API keys can be set in .env (recommended for persistent use) or entered directly in the Web UI. UI values override .env values.
| Variable | Required | Description |
|---|---|---|
RUNNINGHUB_API_KEY |
For FLUX.1-dev & Upscaling | RunningHub API key |
GEMINI_API_KEY |
For Gemini prompt provider | Google Gemini API key |
RUNPOD_API_KEY |
For Z-Image, FLUX.2-klein & Qwen provider | RunPod API key |
RUNPOD_ZIMAGE_ENDPOINT |
For Z-Image | Full RunPod endpoint URL (e.g. https://api.runpod.ai/v2/<id>) |
RUNPOD_FLUX_KLEIN_ENDPOINT |
For FLUX.2-klein | Full RunPod endpoint URL (e.g. https://api.runpod.ai/v2/<id>) |
S3_ENDPOINT |
For Upscaling | S3 API endpoint URL (e.g. https://s3.us-west-004.backblazeb2.com) |
S3_BUCKET |
For Upscaling | Name of the bucket for intermediary image storage |
S3_ACCESS_KEY_ID |
For Upscaling | S3 access key ID |
S3_SECRET_ACCESS_KEY |
For Upscaling | S3 secret access key |
S3_REGION |
For Upscaling | S3 region (default: us-east-1) |
BODY_SIZE_LIMIT |
Always | Maximum upload size in bytes (e.g., 52428800 for 50MB) |
| Setting | Description |
|---|---|
| Generation Model | Choose FLUX.1-dev (RunningHub), Z-Image (RunPod Serverless), or FLUX.2-klein (RunPod Serverless) |
| AI Prompt Provider | Choose between Google Gemini or RunPod (Qwen 30B) for prompt engineering |
| RunningHub API Key | Overrides RUNNINGHUB_API_KEY env var for this session |
| Gemini API Key | Overrides GEMINI_API_KEY env var for this session |
| RunPod API Key | Overrides RUNPOD_API_KEY env var for this session |
| Enable TT-Decoder | Toggle LSB steganography decoding/encoding (FLUX.1-dev only, persisted in localStorage) |
| Parameter | Default | Description |
|---|---|---|
| Aspect Ratio | 1:1 |
9 presets — dimensions are auto-calculated at 16px alignment (FLUX.1-dev and Z-Image only) |
| Output Sub-directory | generations |
Sub-folder inside /mount where results are saved |
| Filename Prefix | image |
Prefix applied to all saved filenames |
| Parameter | Default | Description |
|---|---|---|
| Inference Steps | 50 |
Number of diffusion steps (10–50). 50 recommended for high realism. |
| Guidance Scale | 3.5 |
CFG scale. 3.5-4.5 recommended for realism. |
| Scheduler Shift | 1.5 |
FlowMatch scheduler shift. |
| LoRA Stack | 1 empty row | Multiple LoRAs can be sent via loras[], each with URL, trigger word, and scale. Select from the curated preset dropdown (populated from loras-zimage.json) or enter any URL directly. |
| Seed | -1 (random) |
Fixed seed for reproducibility. |
| Enable High-Res Refinement | off | Runs a second pass for extra detail and upscaling. |
| ↳ Upscale Factor | 1.5 |
Scale multiplier for the refinement pass. |
| ↳ Denoising Strength | 0.18 |
Img2img denoising strength for refinement. |
| ↳ Pass 2 Guidance | 1.2 |
CFG scale for the refinement pass. |
| Parameter | Default | Description |
|---|---|---|
| Quality Preset | realistic_character |
Preset bundle: steps, guidance, shift, and resolution tuned for the use-case. Options: realistic_character, portrait_hd, cinematic_full, fast_preview, maximum_quality, character_portrait_best, character_portrait_vertical, character_cinematic |
| Aspect Ratio | 1:1 |
12 presets (landscape, square, portrait) — all ~1K resolution, 32px-aligned. Landscape: 21:9 (1024×448), 2:1 (1024×512), 16:9 (1024×576), 3:2 (1024×672), 4:3 (1024×768), 5:4 (1024×832). Square: 1:1 (1024×1024). Portrait: 4:5 (832×1024), 3:4 (768×1024), 2:3 (672×1024), 9:16 (576×1024), 1:2 (512×1024). |
| LoRA Stack | 1 empty row | Multiple LoRAs can be sent via loras[], each with URL, trigger word, and scale. Select from the curated preset dropdown (populated from loras-klein.json) or enter any URL directly. |
| Seed | -1 (random) |
Fixed seed for reproducibility. |
| Prompt Length Limit | 512 |
Text encoder token cap (max_sequence_length). |
| LoRA Mix Method | absolute |
Multi-LoRA scale interpretation: absolute (exact strengths) or normalized (auto-balance). |
| Enable Detail Refinement | off | Runs a second inference pass to sharpen fine details and textures. |
| ↳ Refinement Strength | 0.2 |
Img2img denoising strength for the refinement pass. |
| ↳ Refinement Steps | 12 |
Inference steps for the refinement pass. |
| ↳ Refinement Guidance | 1.0 |
CFG scale for the refinement pass. |
| ↳ Refinement LoRA Strength | 1.0 |
Scales LoRA influence during pass 2 (second_pass_lora_scale_multiplier). |
| Enable Upscaling | off | Upscales the generated image server-side before delivery. |
| ↳ Upscale Factor | 2.0 |
Scale multiplier (0.25–4×). |
| ↳ Upscale Blend | 0.35 |
Blending factor between original and upscaled features. |
POST /api/generateSubmits an image generation job. Handles AI prompt engineering via Gemini or RunPod Qwen, then routes to the selected model backend.
{ taskId, model: 'flux-dev', prompt }.loras array. Returns { jobId, model: 'z-image', prompt }.width/height from the selected aspect ratio, multi-LoRA loras, lora_scale_mode, max_sequence_length, optional 2nd pass options, and optional upscale options. Returns { jobId, model: 'flux-klein', prompt }.POST /api/zimage-checkPolls a RunPod job (Z-Image or FLUX.2-klein) for completion. When the job completes, downloads the image from the S3 presigned URL and saves it to the output directory. Returns { status, filename }.
POST /api/upscaleHandles multipart form uploads. Encodes images if requested, uploads to S3, and submits to specialized RunningHub upscaling workflows.
POST /api/checkPolls RunningHub task status and handles post-processing (image download + optional TT-Decode).
GET /api/images/[...path]Serves generated/upscaled images from the mounted output volume.
rhub/
├── src/
│ ├── lib/
│ │ ├── loras-klein.json # FLUX.2-klein LoRA preset list (generated by generate-loras.sh)
│ │ ├── loras-zimage.json # Z-Image LoRA preset list (generated by generate-loras.sh)
│ │ ├── tt-decoder.ts # LSB Steganography extraction
│ │ ├── tt-encoder.ts # LSB Steganography embedding
│ │ ├── s3.ts # S3 Client & Presigned URL logic
│ │ └── locations.ts # 300 photogenic locations
│ └── routes/
│ ├── +page.svelte # Main UI (Runes) — Generate & Upscale tabs
│ ├── +page.server.ts # Server load — passes env-backed API keys + LoRA lists to UI
│ └── api/
│ ├── generate/ # AI Synthesis + Multi-model Submission
│ ├── zimage-check/ # RunPod job polling + image download (Z-Image & FLUX.2-klein)
│ ├── upscale/ # Upload + Encoding + S3 Hosting
│ ├── check/ # RunningHub task polling + TT-Decode
│ └── images/ # Static file serving from /mount
├── generate-loras.sh # Host script — regenerates LoRA JSON configs from local dirs
├── .env.example # Template for secrets and limits
├── .env # Local secrets (gitignored)
├── Dockerfile # Production build
└── docker-compose.yml # Container orchestration
Run the host-side script before rebuilding the container whenever LoRA files are added or removed:
bash generate-loras.sh
docker compose up -d --build
The script scans:
/mnt/backblaze/storage/LoRA/Civitai/flux.2-klein-9b/ → src/lib/loras-klein.json/mnt/backblaze/storage/LoRA/Civitai/zImage/ → src/lib/loras-zimage.jsonPrivate — All rights reserved.