Retro Engine
Play a PS1 game inside ComfyUI and pipe the screen into your workflow
- status
- screen_capture
The "Retro Engine" node is the closest thing ComfyUI has to a Game Boy in your graph. It embeds EmulatorJS - the browser-based emulator project - directly into the ComfyUI frontend, lets you boot a game from any of 34 classic systems, and hands the current screen to the rest of your workflow as a normal IMAGE tensor. You run up to the exact frame you want, queue the prompt, and that screenshot is what your img2img, LoRA, or video nodes get to work with.
Why would you want that? The author (SKBv0, who posted the pack to r/comfyui) said their own use case was generating images for LoRA training - game art is full of clean character and style references, and a real emulator beats scraping screenshots because you can capture exactly the pose and camera angle you need. The thread also floated the fun idea: run a game, capture a frame, img2img it with a turbo model, and you're basically playing a style-transferred game. On a weak system it's sluggish, but for one-off captures it's genuinely delightful.
How it works
Here's the part that surprises people: almost nothing happens in Python. The heavy lifting is EmulatorJS, which runs in your browser inside a dialog the node opens when you click the ⏻ POWER button drawn on the node (the README says "new window" - it's really an in-browser window, no separate OS process). EmulatorJS renders the game to a canvas; when you queue your prompt, the frontend grabs that canvas as a base64 JPEG and stuffs it into a hidden screen_data widget on the node. The Python side then decodes it, resizes to your width/height, and emits it as an image tensor.
That's why the node is so light to install: requirements.txt is just pillow, numpy, and torch - all already present in ComfyUI. No GPU, no model weights, no API key. It's a frontend-extension node that happens to produce an image.
The inputs that matter
- system - the console, defaulting to PlayStation. 34 options from NES/SNES/GBA up through N64, Saturn, PSP, and Commodore.
- game_rom_path - auto-populated from whatever's sitting in
assets/roms/<system_folder>/inside the pack. Subdirectories are scanned recursively, and compressed formats (.7z/.zip/.rar/.chd) are accepted. - core - the emulator core. This is the dropdown that bites you: if it shows
ERROR_CORE_DATA_MISSING_FOR_..., the core files aren't where the node expects, and it will refuse to run (details below). - bios_path - only shown when it matters: PlayStation, SegaCD, SegaSaturn, and 3DO all hard-require a BIOS file or the node errors out.
- width / height - output size, default 640×480 (min 320×240, max 1920×1080, step 8). The game renders internally at a quarter of this and gets Lanczos-upscaled on capture, so it keeps that nice crisp pixel look.
The other two widgets you'll see in a saved workflow - all_options and screen_data - are hidden plumbing (the dropdown cache and the capture buffer). Ignore them.
Outputs are status (a STRING telling you what got captured, cached, or failed) and screen_capture (an IMAGE, 1×H×W×3). Wire screen_capture into a VAE encode for img2img, a LoRA trainer's dataset folder, or straight to a save node.
Installing it
Install the pack, then the cores, then drop in your own games:
cd ComfyUI/custom_nodes
git clone https://github.com/SKBv0/ComfyUI-RetroEngine
(or search "RetroEngine" in ComfyUI Manager) and restart ComfyUI. The real setup step comes after the clone, because the pack deliberately ships no cores to keep the repo small. The README tells you to run npm install @emulatorjs/cores in the pack folder - do that, but know the gotcha: that lands the core .data files inside node_modules/, while the node only checks ComfyUI-RetroEngine/assets/emulator_core/data/cores/. Either copy the <core>-wasm.data files from node_modules/@emulatorjs/core-<name>/ into that folder, or download them straight from the EmulatorJS repo as the folder's own README suggests. Then drop ROMs into assets/roms/<system_folder>/ (e.g. assets/roms/snes/), BIOS files into assets/bios/, and restart.
Troubleshooting
- Core dropdown full of
ERROR_CORE_DATA_MISSING_...- the #1 issue, and it's always the above: no<core>.datafile inassets/emulator_core/data/cores/. EmulatorJS itself can fall back to its CDN, but this node's validation gates on the local file, so get it there and restart. - "No valid ROM file selected" - nothing matching that system's extensions is in the right
roms/<system_folder>/folder, or you left it on theplaceholder_select_a_romoption. - "BIOS file is required for..." - pick a real BIOS in the dropdown for PlayStation/SegaCD/Saturn/3DO.
- Capturing a black frame - the emulator wasn't actually at a screen when you queued, or the capture raced the boot. Let the game settle on a frame, then queue.
One honest warning: this is a small, young pack (v1.0.0, zero ComfyUI search impressions at the time of writing) - expect rough edges and report them on the repo's issues page. But for pulling genuine retro screenshots into a training set or a novelty img2img pipeline, nothing else in the ecosystem quite does this.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| system | COMBO | PlayStation | 34 options: 3DO, Amiga, Arcade, Atari2600, Atari5200, Atari7800, +28 |
| game_rom_path | COMBO | roms/ps1/placeholder_select_a_rom.cue | 34 options: roms/3do/placeholder_select_a_rom.iso, roms/a2600/placeholder_select_a_rom.a26, roms/a5200/placeholder_select_a_rom.a52, roms/a7800/placeholder_select_a_rom.a78, roms/amiga/placeholder_select_a_rom.adf, roms/arcade/placeholder_select_a_rom.zip, +28 |
| core | COMBO | ERROR_CORE_DATA_MISSING_FOR_PLAYSTATION_(pcsx_rearmed) | 34 options: ERROR_CORE_DATA_MISSING_FOR_3DO_(opera), ERROR_CORE_DATA_MISSING_FOR_AMIGA_(puae), ERROR_CORE_DATA_MISSING_FOR_ARCADE_(fbneo), ERROR_CORE_DATA_MISSING_FOR_ATARI2600_(stella2014), ERROR_CORE_DATA_MISSING_FOR_ATARI5200_(a5200), ERROR_CORE_DATA_MISSING_FOR_ATARI7800_(prosystem), +28 |
| bios_path | COMBO | N/A | 1 options: N/A |
| width | INT | 640320–1920 | — |
| height | INT | 480240–1080 | — |
| all_optionsopt | STRING | {"3DO": {"roms": ["roms/3do/placeholder_select_a_rom.iso"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_3DO_(opera)"]}, "Amiga": {"roms": ["roms/amiga/placeholder_select_a_rom.adf"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_AMIGA_(puae)"]}, "Arcade": {"roms": ["roms/arcade/placeholder_select_a_rom.zip"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_ARCADE_(fbneo)"]}, "Atari2600": {"roms": ["roms/a2600/placeholder_select_a_rom.a26"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_ATARI2600_(stella2014)"]}, "Atari5200": {"roms": ["roms/a5200/placeholder_select_a_rom.a52"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_ATARI5200_(a5200)"]}, "Atari7800": {"roms": ["roms/a7800/placeholder_select_a_rom.a78"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_ATARI7800_(prosystem)"]}, "AtariJaguar": {"roms": ["roms/jaguar/placeholder_select_a_rom.j64"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_ATARIJAGUAR_(virtualjaguar)"]}, "AtariLynx": {"roms": ["roms/lynx/placeholder_select_a_rom.lnx"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_ATARILYNX_(handy)"]}, "ColecoVision": {"roms": ["roms/coleco/placeholder_select_a_rom.col"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_COLECOVISION_(gearcoleco)"]}, "Commodore128": {"roms": ["roms/c128/placeholder_select_a_rom.d81"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_COMMODORE128_(vice_x128)"]}, "Commodore64": {"roms": ["roms/c64/placeholder_select_a_rom.d64"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_COMMODORE64_(vice_x64sc)"]}, "CommodorePET": {"roms": ["roms/pet/placeholder_select_a_rom.prg"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_COMMODOREPET_(vice_xpet)"]}, "CommodorePlus4": {"roms": ["roms/plus4/placeholder_select_a_rom.prg"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_COMMODOREPLUS4_(vice_xplus4)"]}, "CommodoreVIC20": {"roms": ["roms/vic20/placeholder_select_a_rom.prg"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_COMMODOREVIC20_(vice_xvic)"]}, "GameBoy": {"roms": ["roms/gb/placeholder_select_a_rom.gb"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_GAMEBOY_(gambatte)"]}, "GameBoyAdvance": {"roms": ["roms/gba/placeholder_select_a_rom.gba"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_GAMEBOYADVANCE_(mgba)"]}, "MAME2003": {"roms": ["roms/mame2003/placeholder_select_a_rom.zip"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_MAME2003_(mame2003)"]}, "MegaDrive": {"roms": ["roms/md/placeholder_select_a_rom.md"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_MEGADRIVE_(genesis_plus_gx)"]}, "N64": {"roms": ["roms/n64/placeholder_select_a_rom.n64"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_N64_(mupen64plus_next)"]}, "NES": {"roms": ["roms/nes/placeholder_select_a_rom.nes"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_NES_(fceumm)"]}, "NeoGeo Pocket": {"roms": ["roms/ngp/placeholder_select_a_rom.ngp"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_NEOGEO_POCKET_(mednafen_ngp)"]}, "NintendoDS": {"roms": ["roms/nds/placeholder_select_a_rom.nds"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_NINTENDODS_(melonds)"]}, "PC Engine": {"roms": ["roms/pce/placeholder_select_a_rom.pce"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_PC_ENGINE_(mednafen_pce)"]}, "PC-FX": {"roms": ["roms/pcfx/placeholder_select_a_rom.cue"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_PC-FX_(mednafen_pcfx)"]}, "PSP": {"roms": ["roms/psp/placeholder_select_a_rom.iso"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_PSP_(ppsspp)"]}, "PlayStation": {"roms": ["roms/ps1/placeholder_select_a_rom.cue"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_PLAYSTATION_(pcsx_rearmed)"]}, "SNES": {"roms": ["roms/snes/placeholder_select_a_rom.smc"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_SNES_(snes9x)"]}, "Sega32X": {"roms": ["roms/sega32x/placeholder_select_a_rom.32x"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_SEGA32X_(picodrive)"]}, "SegaCD": {"roms": ["roms/segacd/placeholder_select_a_rom.cue"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_SEGACD_(genesis_plus_gx)"]}, "SegaGameGear": {"roms": ["roms/gg/placeholder_select_a_rom.gg"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_SEGAGAMEGEAR_(genesis_plus_gx)"]}, "SegaMasterSystem": {"roms": ["roms/sms/placeholder_select_a_rom.sms"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_SEGAMASTERSYSTEM_(smsplus)"]}, "SegaSaturn": {"roms": ["roms/saturn/placeholder_select_a_rom.cue"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_SEGASATURN_(yabause)"]}, "VirtualBoy": {"roms": ["roms/vb/placeholder_select_a_rom.vb"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_VIRTUALBOY_(beetle_vb)"]}, "WonderSwan": {"roms": ["roms/ws/placeholder_select_a_rom.ws"], "cores": ["ERROR_CORE_DATA_MISSING_FOR_WONDERSWAN_(mednafen_wswan)"]}} | — |
| screen_dataopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |
| screen_capture | IMAGE | — |