Extensions/ComfyUI-RMAutomation
ComfyUI Extension

ComfyUI-RMAutomation

Automation nodes for ComfyUI: RM Styles (load prompts from JSON with random/increment modes), Power LoRA Loader (advanced LoRA loading with random weights), image fallback, mask gate, latent operations, and video combine nodes.

By Moser9815·Created 7 months ago·Updated about 4 hours ago· 0
Moser9815/ComfyUI-RMAutomation
Nodes23
On cloudLocal install
CategoryRMAutomation/Face, RMAutomation/Image
Stars0
Updatedabout 4 hours ago

Nodes (23)

RM Face Composite

Stitch the fixed-up faces back onto the original image

RMAutomation/Face
RM Face Detect & Crop

Crop every face out of a shot and run each one through its own pipeline

RMAutomation/Face
RM Image Fallback

Pick the first image that actually exists

RMAutomation/Image
RM LoRA Apply

Apply a whole LoRA stack to your model and CLIP in one node

RMAutomation/LoRA
RM LoRA Collector

Merge LoRA stacks and lora strings into one combined stack

RMAutomation/LoRA
RM Make Image Batch

Shove any number of images into one batch for batch sampling

RMAutomation/Image
RM Mask Combine

Combine body, face and object masks into one inpainting mask

RMAutomation/Mask
RM Mask Denoise Remap

Map mask brightness to per-region denoise strength

RMAutomation/Mask
RM Mask Gate

Stop empty masks from crashing your workflow

RMAutomation/Mask
RM Mask Gate (Guide)

Kill a guide conditioning when the mask is empty

RMAutomation/Mask
RM Math Expression

Do the math in your graph, not in your head

RMAutomation/Utils
RM Multi-Detect & Crop

Detect with several models at once and crop every hit

RMAutomation/Detection
RM Negative Text Embed

The negative-prompt encoder that merges a style string with your manual text

RMAutomation/Text
RM Positive Text Embed

The positive-prompt encoder that merges two text sources

RMAutomation/Text
RM Power LoRA Loader

Stack a dozen LoRAs, randomize the weights, or pull them straight off Civitai

RMAutomation/LoRA
RM Power LoRA Loader (Pipe)

The Power LoRA Loader that reads its LoRAs from a style pipe

RMAutomation/LoRA
RM Save Image With Metadata

Saves PNGs with the workflow baked in — after you fix the hardcoded paths

RMAutomation/Image
RM Set Latent Noise Mask

Set a noise mask on your latents without crashing on an empty one

RMAutomation/Latent
RM Styles Full

Your whole prompt library behind one dropdown and an Edit button

RMAutomation/Styles
RM Styles Full (Display)

The style shelf that shows its work before you hit generate

RMAutomation/Styles
RM Styles Pipe

One wire for your whole prompt library

RMAutomation/Styles
RM Styles Pipe Out

Where the style pipe spills back out — and why there's a Pony switch

RMAutomation/Styles
RM Video Combine

Turn your frames into H.264, WebP, or GIF without a second node pack

RMAutomation/Video
Readme

ComfyUI-RMAutomation

A collection of workflow automation nodes for ComfyUI, designed to streamline AI image and video generation workflows.

Installation

Via ComfyUI Manager (Recommended)

  1. Open ComfyUI Manager
  2. Search for "RMAutomation"
  3. Click Install

Manual Installation

cd ComfyUI/custom_nodes
git clone https://github.com/yourusername/ComfyUI-RMAutomation

Nodes

LoRA Nodes

RM Power LoRA Loader

A flexible node for loading multiple LoRAs with support for:

  • Dynamic number of LoRA inputs (add as many as you need)
  • Fixed or random strength per LoRA
  • Two ways to feed LoRAs in automatically, both optional:
    • Styles Pipe + lora_source (Image / Motion High / Motion Low) - reads the selected LoRA string straight out of an RM_STYLES_PIPE
    • Style Import - a raw LoRA string, for graphs with no pipe
    • If both are connected the pipe wins, as the more specific intent
  • Civitai AIR mode - download LoRAs by model ID

Previously two nodes, RM Power LoRA Loader and RM Power LoRA Loader (Pipe), merged 2026-08-24. The single node is a superset of both. The old RMPowerLoraLoaderPipe key is still registered as an alias so existing workflows load unchanged - it resolves to the same class and shows the same name.

RM LoRA Collector

Combines multiple LoRA stacks into one. Accepts both LORA_STACK inputs and lora strings.

RM LoRA Apply

Applies all LoRAs from a collected stack to the model and CLIP.

Styles Nodes

RM Styles Full

Load prompts from a JSON styles file with multiple selection modes:

  • Manual: Use specific prompt number
  • Random: Random selection within range
  • Increment: Auto-increment after each generation
  • Decrement: Auto-decrement after each generation

Features an Edit Styles button that opens a modal editor for managing your styles.

RM Styles Full (Display)

Same as RM Styles Full but displays the current prompt on the node.

RM Styles Pipe / RM Styles Pipe Out

Pack and unpack style data for easier workflow connections.

Video Nodes

RM Video Combine

Combines images into video with:

  • Multiple format support (H.264, H.265, VP9, GIF, WebP)
  • Configurable output directory
  • Metadata embedding
  • Audio support
  • Ping-pong looping

Utility Nodes

RM Image Fallback

Returns the first non-empty image from multiple inputs. Useful for conditional workflows.

RM Mask Gate

Validates masks and passes through only valid ones. Outputs None for invalid masks, preventing crashes in downstream nodes.

RM Mask Gate (Guide)

Same as Mask Gate but for guide inputs. Disables guides when masks are invalid.

RM Set Latent Noise Mask

Improved latent noise mask setter with proper error handling for edge cases.

RM Positive/Negative Text Embed

CLIP text encoding nodes that combine optional string inputs with text fields.

Styles JSON Format

The styles file (data/styles.json) uses this format:

{
  "styles": [
    {
      "number": 1,
      "name": "Style Name",
      "positive": "positive prompt text",
      "negative": "negative prompt text",
      "motion": "motion prompt for video",
      "imageLoras": [
        {"path": "lora_name.safetensors", "weight": 1.0}
      ],
      "motionLoras": [],
      "motionLorasHigh": [],
      "motionLorasLow": []
    }
  ]
}

Using a custom styles file

The RM Styles nodes read data/styles.json by default. Point the custom_json_path widget at another file to override that. The path accepts:

| Form | Example | |---|---| | Absolute | C:\Users\you\Styles\styles.json | | Quoted (Explorer "Copy as path") | "C:\Users\you\Styles\styles.json" | | Home-relative | ~/Styles/styles.json | | Environment variable | %USERPROFILE%\Styles\styles.json | | Relative | styles/mine.json — resolved against the ComfyUI root |

Leave it blank to use the bundled default. The Edit Styles button reads and writes whichever file the widget points at.

Converting a styles CSV

tools/csv_to_styles.py converts a styles CSV (the A1111 styles.csv shape, or the Number,Name,Positive,Negative,Lora shape) into the JSON format above.

Double-click tools/Convert Styles CSV.cmd and it walks you through it: an Open dialog for the CSV, a Save As dialog for the JSON, then the summary stays on screen until you press Enter. You can also drag a CSV onto the launcher to preselect it.

Use the .cmd, not the .py — editors like Cursor and VS Code claim the .py extension via the per-user UserChoice registry key, so double-clicking the script opens the editor instead of running it. (Note that assoc .py / ftype will still report py.exe; they read machine-level associations, which UserChoice overrides.)

The dialogs need a Python install with tkinter. The python_embeded shipped with ComfyUI portable has none, so use the command line below if that's your only Python.

# Same dialogs, from a terminal
python tools/csv_to_styles.py

# Or give the paths directly (no dialogs, no pause - good for scripting)
python tools/csv_to_styles.py "ComfyUI/styles/StylesSFW.csv" "my_styles.json"

It repairs the things that otherwise make the node fail or silently drop styles: non-UTF-8 encodings, BOMs, nameless trailing columns, malformed lora tags (<lora:X:1), space-separated tags, .8-style weights), non-breaking spaces, control characters and embedded newlines, doubled commas, and blank, duplicate, zero or negative style numbers. It prints a summary of every repair, then re-reads the file the way the node does and reports how many styles will actually load.

Useful flags: --dry-run (report without writing), --start-number N (first number used when renumbering), --encoding (force a source encoding).

Custom Video Formats

Add custom video formats by placing JSON files in the video_formats directory. Example format:

{
  "extension": "mp4",
  "main_pass": ["-c:v", "libx264", "-preset", "medium", "-crf", "19", "-pix_fmt", "yuv420p"],
  "audio_pass": ["-c:a", "aac", "-b:a", "192k"],
  "save_metadata": "True",
  "dim_alignment": 2
}

License

MIT License - Do whatever you want with this code.

Credits