A ComfyUI custom node + script that turns a news story's text into a finished poster: a generated illustration with a styled headline/caption banner underneath.
- Two ComfyUI workflows (
prompt-gen.json,caption-gen.json) run the story through Comfy's built-inTextGeneratenode (Qwen3-4B) to produce (a) a rich image-generation prompt, and (b) a short headline + body caption. - A third workflow (
t2i.json) generates a 1024x1024 image from that prompt (Z-Image-Turbo / Lumina2). generate_poster.pysubmits all three workflows over ComfyUI's HTTP API, renders the caption banner with ImageMagick, and composites the final poster.
No separate LLM server process is needed — the LLM runs natively inside
ComfyUI's own model pipeline. OilrigSaveText (in __init__.py) is the one
small custom node this depends on, used to retrieve the generated text back
out over ComfyUI's API.
- ComfyUI, with these three model files already set up for use:
qwen_3_4b.safetensors(CLIP loader, typelumina2) — doubles as the LLM for both text-generation stepsz_image_turbo_bf16.safetensors(UNet / diffusion model)ae.safetensors(VAE)
- ImageMagick v6 or v7 installed and on PATH (supports both
magickand legacyconvertcommand execution) - Python 3 with
Pillowandrequests— see Setup below
- Clone this repo into your ComfyUI directory:
cd ComfyUI/custom_nodes git clone https://github.com/FNGarvin/oilrig.git oilrig - Restart ComfyUI to load the custom node pack. Inspect ComfyUI console logs to confirm
oilrighas successfully initialized. - The workflow templates
prompt-gen.json,caption-gen.json, andt2i.jsonare packaged and ready to run inside the repo without further configuration.
generate_poster.py is a standalone command-line script. While ComfyUI imports __init__.py as a custom node pack at boot, it never runs the script directly. To execute the CLI tool, use a Python environment that has Pillow and requests installed:
- ComfyUI Virtual Environment: If configured, you can call ComfyUI's python executable directly:
/path/to/ComfyUI/.venv/bin/python generate_poster.py "Your story text here" - ComfyUI Portable (Windows): If using the portable distribution, execute via the embedded Python folder:
C:\path\to\ComfyUI_windows_portable\python_embeded\python.exe generate_poster.py "Your story text here" - Custom Environment: Alternatively, set up your own isolated environment:
(or with uv:
pip install -r requirements.txt
uv venv && uv pip install -r requirements.txt)
Important
If your ComfyUI server listens on a custom host/port (other than the default http://127.0.0.1:8188), you can pass the appropriate target via the --comfy-url command-line option or by setting the COMFY_URL environment variable.
You can also pull in long-form story or article contents dynamically from a text file:
python generate_poster.py --story-file mystory.txtEach execution creates a dedicated storage folder under output/<timestamp>/ containing:
generated.png(Raw 1024x1024 image output from T2I)banner.png(Generated layout containing the title block and subtext)poster.jpg(Finished composite graphic)run.log(Internal operation/parameters transcript text)
The automated script run_tests.py runs a series of mock test scenarios (including the headline-making test that inspired this project name) sequentially to verify end-to-end functionality.
Here is a visual collection of the test cases executed by run_tests.py, displaying the source news text next to the generated final composition:
output_eval_gen.jsoncontains a bonus evaluation workflow containing a vision-capableTextGenerateinstance to score generated photos against their input prompt descriptions. This file is retained for future iteration or direct evaluation runs and is not executed by default ingenerate_poster.py.
This project is licensed under the terms of the MIT License. See LICENSE for details.






