ComfyUI Extension
ComfyUI-RetroEngine
A ComfyUI custom node that integrates EmulatorJS, allowing you to run retro games and capture their screens for image generation workflows.
SKBv0/ComfyUI-RetroEngine
Nodes1
On cloudLocal install
CategoryRetro Engine
Stars13
Updated2 months ago
Nodes (1)
Readme
<div align="center">
<h1>Retro Engine Node for ComfyUI</h1>
<img src="assets/logo.png" alt="Retro Engine Logo" width="200"/>
</div>
This custom node integrates EmulatorJS into ComfyUI, allowing you to run retro games and capture their screens for your image generation workflows.
https://github.com/user-attachments/assets/1894a9f6-4e30-4658-b014-143696e800c1
Key Features
- Run games from many classic consoles.
- Dynamically select systems, ROMs, and emulator cores.
- Automatically capture emulator screens into your ComfyUI workflow.
Installation
-
Add to ComfyUI:
- Place the
ComfyUI-RetroEnginefolder (this repository) into your ComfyUIcustom_nodesdirectory.
- Place the
-
Install Emulator Cores (Required):
- This node uses EmulatorJS cores which need to be installed via npm.
- To install all official cores (recommended for ease):
npm install @emulatorjs/cores - Alternatively, to install a specific core (e.g.,
snes9xfor SNES):npm install @emulatorjs/core-snes9x - *Ensure npm is installed on your system.
Basic Usage
-
Place Game Files:
- Put your game ROMs into the
ComfyUI-RetroEngine/assets/roms/[SYSTEM_FOLDER]/directory (e.g.,assets/roms/snes/for SNES games). - If a system requires a BIOS file (like PlayStation), place it in
ComfyUI-RetroEngine/assets/bios/.
- Put your game ROMs into the
-
Add and Configure Node:
- Add the "Retro Engine" node to your ComfyUI workflow.
- System: Choose the game system (e.g., SNES, PlayStation).
- Game ROM: Select your game from the list.
- Core: Ensure an appropriate core is selected (usually automatic).
- BIOS: If needed for the system, select the BIOS file.
- Width/Height: Set the desired output image size.
-
Run Emulator & Capture:
- Click the POWER (⏻) button on the node to start the emulator in a new window.
- Navigate to the desired screen in your game.
- Queue the ComfyUI prompt. The node will capture the screen and output it as an IMAGE.
Important Notes & Troubleshooting
- BIOS Required for Some Systems: Systems like PlayStation, SegaCD, Saturn, and 3DO must have a correct BIOS file selected in the node to work.
- Emulator Cores Not Found? If the node can't find a core for a selected system, or you get errors related to cores:
- Ensure you have installed the necessary cores via
npm install @emulatorjs/coresornpm install @emulatorjs/core-<core_name>(see Installation section). - The node will try to pick a default core, but some systems might offer multiple. You might need to select one from the "Core" dropdown.
- Ensure you have installed the necessary cores via
- Game ROMs/BIOS Not Listed?
- Make sure files are in the correct
assets/roms/[SYSTEM_FOLDER]/orassets/bios/subdirectories within theComfyUI-RetroEnginefolder. - Restart ComfyUI after adding new game files.
- Make sure files are in the correct
Credits
- This ComfyUI node heavily utilizes and is made possible by the EmulatorJS project.
- For more details on the core emulation technology, please visit their GitHub page or emulatorjs.org.