Real-time generative visualization for interactive fiction.
Project description
PipeDream
PipeDream is a utility that adds a visual dimension to text-based interactive fiction. It operates by capturing the standard output of terminal games and generating real-time illustrations of the current scene using generative AI.
Core Goals
-
Universal Compatibility If a game runs in a terminal and outputs text to stdout, PipeDream should be able to visualize it. This includes Z-Machine interpreters (Frotz), Python text adventures, or custom binaries.
-
Real-Time Responsiveness The visualization process must be fast enough to keep pace with the gameplay loop. The architecture prioritizes low latency to maintain immersion.
-
Visual Consistency The tool aims to maintain narrative coherence. If a player drops an item or revisits a room, the generated imagery should reflect the previous state rather than hallucinating a completely new environment.
Current Status
Status: Functional Prototype (GUI)
The project now features a functional GUI that separates the game terminal from the visual output.
- Engine: Captures game output via
pexpect(Unix) orPopen(Windows). - Director: Uses an LLM to interpret game text into visual prompts.
- Navigator: A graph-based state machine that maps the game world as you explore, early attempt at backtracking and spatial consistency.
- Generator: Calls external image generation APIs (via
litellm) and saves results to a local cache. - Interface: A PySide6 (Qt/QML) application providing a split-view experience: game terminal on the right, AI visualization on the left.
Features & Usage
Visual Styles
You can customize the art style of the generation using the --art-style flag. The default is "Oil painting, dark fantasy, atmospheric".
# Example: Pixel Art Style
pipedream-gui --art-style "Retro 8-bit pixel art, green monochrome" adventure
# Example: Pencil Sketch
pipedream-gui --art-style "Rough pencil sketch on parchment" adventure
Cache Management
PipeDream caches images aggressively to save API costs and speed up backtracking. If you want to regenerate the world from scratch (e.g., after changing styles), use the clear cache flag.
# Wipes the cache and resets the world map
pipedream-gui --clear-cache adventure
Quick Start (Dev)
1. Install Dependencies
Install the package in editable mode to register the pipedream-gui command.
pip install -e .
- Configure Environment:
Create a
.envfile in the root directory. You need keys for both the LLM (Director) and the Image Generator.
GEMINI_API_KEY=your_api_key_here
LLM_MODEL=gemini/gemini-2.5-flash
IMAGE_MODEL=gemini/gemini-2.5-flash-image
- Run a Game: PipeDream works by wrapping any console command.
Example: Colossal Cave Adventure (Python Port)
First, install the game so it is available globally (outside the project environment). Using uv is recommended:
uv tool install adventure
(Windows User Note: If you encounter readline errors, install with the Windows patch: uv tool install adventure --with pyreadline3 --force)
Launch with PipeDream:
pipedream-gui adventure
Example: Generic Use
You can wrap other interpreters (like Frotz) similarly:
# Syntax: pipedream-gui <command_to_run_game>
pipedream-gui frotz games/zork1.z5
Troubleshooting
Windows "Shim" Errors: If you get errors running a Python game on Windows, try wrapping the command in cmd /c to force proper path resolution: pipedream-gui cmd /c adventure
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pipedream_fiction-0.2.0.tar.gz.
File metadata
- Download URL: pipedream_fiction-0.2.0.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afe859ad7b64a6dfea5d74dd2f82867aa428c95518743c9a4fffae2ef903d123
|
|
| MD5 |
d63793bdc9643d967ab2f2d1ed9535de
|
|
| BLAKE2b-256 |
5982e8f65c64e2305e6f85ea5e20c4faa419601ecd982a2ef81cf12bf51a6177
|
File details
Details for the file pipedream_fiction-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pipedream_fiction-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b78c2c5e4d91f04cd10ccc406a6919cde53e5e881db0b12fb8f7e5cf735b6608
|
|
| MD5 |
53555187578f88b54a113d578de9e2a8
|
|
| BLAKE2b-256 |
9753329bf47e142c04c7fb2cf10cfd4358ab3997f00e2b61e403aea1ace5c186
|