AI Roguelite
十分な評価がありません
Adding ComfyUI Custom Workflows
作者: Uncertain
How to set up and use custom ComfyUI workflows, with LoRAs or anything else, in AI Roguelite.
   
アワード
お気に入り
お気に入り
お気に入りから削除
Handy Files
In case you'd rather read it, the game’s Readme about this is located in:
\AI Roguelike\ai-roguelite-config\default\model-params\README.txt

The game’s default ComfyUI workflow, which can be renamed to .json and loaded into CUI as an example:
\AI Roguelike\ai-roguelite-config\default\model-params\comfyui-prompt-params.txt
Making It
In ComfyUI, build a workflow you want the game to use to generate every image. You can link the game’s internal variables to any node inputs of your choice by writing a special assignment code into a node’s title.

A node title containing input=value (where input names one of the node’s inputs, and value is one of the special keywords below) will overwrite that input with the specified value from the game. The node title can still contain normal text:



These keywords each represent a value made available to your workflow by the game:

AIRL_SIZE_X
Image width
AIRL_SIZE_Y
Image height
AIRL_STEPS
Step total
AIRL_PROMPT
Prompt
AIRL_NEG_PROMPT
Negative prompt
AIRL_CKPT_NAME
Checkpoint filepath
AIRL_SEED
Seed

Width, height, steps, negative prompt and checkpoint filepath are specified by the player in the game’s options; prompt and seed are generated by the game while playing.

If you wish, you can:
  • send the same variable to multiple nodes;
  • ignore any/all game variables completely (except AIRL_PROMPT, it breaks without it);
  • set your step counts inside the workflow and use AIRL_STEPS to do custom math instead;
  • do whatever madness you want.
The game simply takes any workflow you can dream up, lets you decide how the game’s variables should be used, and runs it. The workflow just needs to end with a Save Image node.
Using It
You’ll need to create a local mod containing your workflow for the game to use.

In the game’s Options → Mods menu, click Create Your Own Mod at the top, then open the new mod’s folder using the button on its far right.

Here, you can delete all folders except prompts to clean it up (deleting the empty prompts has caused me problems). Add a new folder named model-params:



With Dev Mode enabled in ComfyUI’s settings, save your workflow in API format (I would remove any Preview Image nodes first: see below). The saved file must be named comfyui-prompt-params.txt (not .json) and placed into your mod’s model-params folder.

Enable your mod in the game’s mods menu, and that should be it. To update it, just overwrite the file with a new version, and (I think) opening and closing Options should reload the mod instantly.

Troubleshooting
If the game hangs, fails to generate images, or generates them but does not actually show them:
  • Hit ` to check the game’s console for errors;

  • Check ComfyUI’s prompt readout for errors;

  • If images seem to generate but are not displayed, it seems like this is caused by Preview Image nodes existing in the workflow. My guess is these confuse the game and misdirect it from saving its own copy of the image into your adventure’s save folder.

Kool Tips
  • With workflows as mods, you can quickly switch between workflows which use different checkpoints, ignoring the checkpoint from the game's Image Gen options. A realistic one with CLIP Skip -1 and an anime duplicate with CLIP Skip -2, perhaps.

  • The game's default workflow doesn't use a VAE unless one happens to be baked into your checkpoint.

  • Although you can add things like, "best quality, high quality" to every image via the game's options, it adds those phrases to the start of the prompt. In the workflow you can take AIRL_PROMPT and concatenate your favourite quality text to the end instead.

  • For really fast images that look decent, I suggest using SD 1.5 with TCD to get ludicrously fast generation speeds, adding a low-step FaceDetailer to fix faces, then building upon that until you fall over. If you mash enough guidance enhancement onto TCD it can look relatively good in 10 steps.

  • If you're new to ComfyUI, remember that the custom nodes you can download are Python code which can rarely be incredibly malicious. One node just about stole some guy's identity. They've added security since then, but I still suggest sticking to as few popular/trusted ones as you need.

  • LoRAs for all. Hooray~