Hypnagogia

May 11, 2026 · View on GitHub

An interactive dream machine, forked from Overworld's local gameplay client, with ComfyUI integration.

The first frame is generated using text-to-image (Z Image Turbo). You can then explore the dream world using WASD + mouse, with control over its direction:

  • Left-click regenerates the current frame using image-to-image (SDXL Turbo) and injects the result back into the world model, partially restabilising the dream while converting local hallucinations into global ones
  • Right-click analyses the current frame with a vision language model (e.g. GPT-4o) to generate a new prompt based on what it sees, letting the dream evolve organically
  • Scroll wheel adjusts the denoise strength for I2I regeneration (0-100%)
  • ESC opens a pause menu for editing the prompt, selecting from presets, or adjusting settings

Periodic automatic repainting is supported via the --i2i-interval flag, but is off by default.

Requirements

For the world model:

  • Windows
  • Nvidia RTX 3xxx / 4xxx / 5xxx GPU
  • CUDA 12.8

For the generations:

  • ComfyUI (on another GPU/machine; running both models on the same GPU will likely make you very sad)
  • Hardware capable of generating SDXL Turbo outputs in <100ms (faster the better)

For vision analysis (optional):

  • OpenAI API key (or compatible vision API endpoint)

Configuration

Update config.json as appropriate. The ComfyUI workflows are specialised to the default models, so changing them is unlikely to work out of the box.

CLI Arguments

ArgumentDefaultDescription
--url(required)ComfyUI server URL
--promptrandom from prompts.txtInitial text prompt
--seedrandomSeed for reproducible generation
--n-frames4096Frame buffer size before auto-reset
--i2i-interval0 (disabled)Frames between automatic I2I regenerations
--i2i-vlm-regenfalseUse VLM to generate new prompt before I2I regeneration (requires --i2i-interval)
--denoise0.4Denoising strength for I2I regeneration (0.0-1.0)
--devicecudaPyTorch device
--modelOverworld/Waypoint-1.5-1BWorld engine model URI (HF id)
--quantnoneWorld model quantization (intw8a8, fp8w8a8, nvfp4)
--mouse-sensitivity1.5Mouse control multiplier
--vision-api-urlhttps://api.openai.com/v1Vision API base URL
--vision-modelgpt-4oVision model name

The default world model is Overworld/Waypoint-1.5-1B. Waypoint-1.5 produces multiple frames per inference step (temporal compression > 1) at 1280×720; the client spreads each batch over the model's inference_fps using a dispatch-first pipeline that overlaps rendering with GPU computation. Single-frame Waypoint-1 / 1.1 models are still supported — set models.world_engine in config.json to switch.

Example

uv run src/client.py --url http://comfyui:8188 --vision-api-url http://vlm-server:7070/v1 --vision-model gpu:qwen3-vl-30b-a3b-instruct

Controls

InputAction
WASD + MouseNavigate the dream world
Left-clickRegenerate frame with I2I and inject
Right-clickAnalyse frame with VLM for new prompt
Scroll wheelAdjust denoise strength
Q (hold)Browse image history (click to restore prompt)
UManual reset
ESCOpen pause menu