Advanced image and video 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, selectable RunningHub image upscaling with LSB steganography support, image enhancement via fal.ai Phota and RunningHub workflows, video creation via fal.ai Seedance 2.0, and real-time polling.
rhub is a specialized SvelteKit-based dashboard that transforms simple subject descriptions into high-quality, LoRA-consistent imagery and video. It solves the "repetition problem" in AI generation by bridging expert prompt engineering (Gemini/Qwen) with multiple synthesis pipelines.
nomos_webphoto, nomos_webphoto_esrgan, or purephoto) and defaults to an img2img hires-fix pass that upscales first, then lightly re-diffuses to clean super-resolution artifacts.bytedance/seedance-2.0/reference-to-video). Supports up to 9 reference images, up to 3 reference videos, up to 3 reference audio files, 480p/720p/1080p resolution, duration, aspect ratio, audio generation, seed, and optional end-user ID. Inputs are validated locally against fal.ai's schema before submit to prevent avoidable 422 errors. FAL jobs are polled asynchronously and videos are saved to the output volume. Any generated image in the queue can be sent directly to the video tab as a reference image..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, direct RunPod Serverless calls, fal.ai enhancement, and fal.ai video generation. Images and videos 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 preferred multi-LoRA loras array when LoRAs are configured.upscale_model. The default is nomos_webphoto, a natural RealPLKSR photo upscaler; nomos_webphoto_esrgan and legacy purephoto are also available.second_pass_enabled=true): it upscales the base image by 1.25×, then re-diffuses through Z-Image img2img at strength 0.42. A 1024×1024 request returns a 1280×1280 PNG by default.upscale_enabled=true, upscale_factor=1.5) with no diffusion repaint. A 1024×1024 request then returns a 1536×1536 PNG./api/zimage-check until the job completes, then downloads the image 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.fal-ai/phota/enhance synchronously; result is downloaded and saved./api/check for completion and downloads the result.POST https://queue.fal.run/bytedance/seedance-2.0/reference-to-video./api/video-check every 5 seconds. When complete, the mp4 is downloaded and saved to the output volume.2053348161841836033 with node 125.# 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
The container is intended to be reached through NPM Proxy Manager on the shared Docker network. It does not expose the application port directly to the local host, so use the configured proxy hostname for browser access rather than localhost:3000.
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 Enhance | 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 |
FAL_KEY |
For Enhance (Phota) & Create Video | fal.ai 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 & RunningHub Enhance uploads | S3 API endpoint URL (e.g. https://s3.us-west-004.backblazeb2.com) |
S3_BUCKET |
For Upscaling & RunningHub Enhance uploads | Name of the bucket for intermediary image storage |
S3_ACCESS_KEY_ID |
For Upscaling & RunningHub Enhance uploads | S3 access key ID |
S3_SECRET_ACCESS_KEY |
For Upscaling & RunningHub Enhance uploads | S3 secret access key |
S3_REGION |
For Upscaling & RunningHub Enhance uploads | 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 |
| fal.ai API Key | Overrides FAL_KEY env var for this session (used by Enhance and Create Video) |
| Upscale Engine | Choose RunningHub — 2K Upscale or RunningHub — API Upscale for tasks added from the Upscale tab |
| Enable TT-Decoder | Toggle LSB steganography decoding/encoding for supported RunningHub generation and upscale workflows |
| 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. 50 is the current upstream Base-model sweet spot for detail. |
| Guidance Scale | 4.5 |
CFG scale. 4.5 is the current photorealism default; higher increases adherence but can over-saturate. |
| Scheduler Shift | 1.0 |
FlowMatch scheduler shift. 1.0 matches the Z-Image architecture/scheduler default and preserves detail refinement. Raise only when a specialized LoRA requires it. |
| CFG Normalization | on | Enabled by default per the official Tongyi-MAI photorealism recommendation. |
| CFG Truncation | 1.0 |
Recommended default. Lower values can reduce over-saturation. |
| Beta Sigmas | off | Disabled by default to match the official Z-Image noise distribution. |
| 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. |
| Detail Upscaler | nomos_webphoto |
Selects the serverless upscale_model. Options are nomos_webphoto, nomos_webphoto_esrgan, and purephoto. |
| img2img Hires-Fix | on | Default finishing path. Upscales with the selected detail model, then lightly re-diffuses through Z-Image img2img. Replaces single-pass detail upscale when enabled. |
| ↳ Hires-Fix Upscale Factor | 1.25 |
Scale multiplier for the img2img hires-fix path. 1.25× stays within 24 GB with LoRAs loaded; 1024×1024 returns 1280×1280 by default. |
| ↳ Denoising Strength | 0.42 |
Img2img denoising strength tuned to clean base-pass and super-resolution artifacts without losing composition. Lower values preserve more first-pass character detail; higher values refine more aggressively. |
| ↳ Pass 2 Steps | 28 |
Inference steps for the img2img pass. |
| ↳ Pass 2 Guidance | 4.5 |
CFG scale for the img2img pass. |
| ↳ Pass 2 Prompt Limit | 512 |
Token limit for the pass-2 prompt encoder. |
| Single-Pass Detail Upscale | on | Used only when img2img Hires-Fix is disabled. Runs pure feed-forward super-resolution with no diffusion repaint. |
| ↳ Detail Upscale Factor | 1.5 |
Net output scale for the single-pass detail upscale. A 1024×1024 request returns a 1536×1536 PNG when Hires-Fix is disabled. |
| 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 (hardcoded) |
Currently hardcoded to absolute. The serverless worker also supports normalized, but rhub does not expose a UI control for it. |
| 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 | 4 |
Inference steps for the refinement pass. The serverless worker clamps this to 1..8. |
| ↳ Refinement Guidance | 1.0 (server-forced) |
The serverless worker forces second_pass_guidance_scale to 1.0; rhub does not send this field. |
| ↳ Refinement LoRA Strength | — | Not applicable. LoRAs are fused into model weights at init time, so there is no per-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. |
| Parameter | Default | Description |
|---|---|---|
| Prompt | — | Text description of the video. Reference files as @Image1, @Video1, and @Audio1. |
| Reference Images | up to 9 | JPEG/PNG/WebP — paste URL or upload from device. Sent as image_urls[]. |
| Reference Videos | up to 3 | MP4/MOV — paste URL or upload from device. Sent as video_urls[]. Combined reference video duration should be 2–15 seconds; uploaded video data URIs are limited to 50MB total. |
| Resolution | 720p |
480p (faster), 720p (balanced), or 1080p (highest quality). |
| Duration | auto |
auto or 4–15 seconds. |
| Aspect Ratio | auto |
auto, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16. |
| Generate Audio | on | Synthesize synchronized sound effects, ambient audio, and lip-sync. |
| Reference Audio | up to 3 | MP3/WAV — paste URL or upload from device (shown when Generate Audio is on). Reference audio requires at least one reference image or video. Leaving this empty while Generate Audio is on is valid; Seedance generates audio itself. |
| Seed | -1 (random) |
Fixed seed for reproducibility. |
| End User ID | blank | Optional fal.ai end-user identifier. Sent as end_user_id when provided. |
| Output Directory | generations |
Sub-folder inside /mount where the mp4 is saved. |
| Filename Prefix | video |
Prefix applied to saved mp4 filenames. |
Create Video validation is enforced before fal.ai submission. Reference images must be JPEG/PNG/WebP and no more than 30MB each. Reference videos must be MP4/MOV and uploaded video data URIs are limited to 50MB total. Reference audio must be MP3/WAV and no more than 15MB each. fal.ai accepts public http(s) URLs or base64 data URIs for file inputs. The Seedance request can include no references at all, image references, video references, audio references with at least one image/video reference, or any supported combination within the 12-file total limit.
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, Base-model defaults (steps=50, shift=1.0, cfg_normalization=true), selectable upscale_model, default img2img hires-fix controls, and fallback single-pass detail upscale controls. 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 the selected RunningHub upscaling workflow. upscaleEngine may be runninghub-2k or runninghub-api.
runninghub-2k submits to the existing 2K workflow (2022348592370950145) or the TT carrier workflow (2022423075609907202) when useTtDecoder=true.runninghub-api submits to app 2053348161841836033 with nodeInfoList[0].nodeId = "125" and the uploaded image presigned URL as fieldValue.POST /api/checkPolls RunningHub task status and handles post-processing (image download + optional TT-Decode).
POST /api/enhanceHandles image enhancement. Accepts multipart form with engine (fal, runninghub, runninghub-detail, runninghub-hd-detail), image file or URL. For fal.ai Phota: runs synchronously and returns { filename }. For RunningHub engines: uploads files to S3 for a temporary presigned URL when needed, submits the URL to RunningHub, and returns { taskId } for polling.
POST /api/videoSubmits a video generation job to the fal.ai queue (bytedance/seedance-2.0/reference-to-video). Supports the fal.ai input surface: prompt, image_urls, video_urls, audio_urls, resolution, duration, aspect_ratio, generate_audio, seed, and end_user_id. Validates prompt, enum values, reference counts, URL/data URI shape, MIME types, uploaded data URI size limits, and the fal.ai rule that reference audio requires an image/video reference. Returns { requestId, statusUrl, responseUrl, outputDir, prefix }.
POST /api/video-checkPolls a fal.ai video job for completion. When complete, downloads the mp4 and saves it to the output directory. Returns { status, filename }.
GET /api/images/[...path]Serves generated/upscaled/enhanced images and videos 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, Enhance & Create Video 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
│ ├── enhance/ # Image enhancement (fal.ai Phota / RunningHub workflows)
│ ├── video/ # fal.ai Seedance 2.0 video submission
│ ├── video-check/ # fal.ai video job polling + mp4 download
│ └── 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.jsonbytedance/seedance-2.0/reference-to-video)Private — All rights reserved.