richservo/rs-nodes

36

stars

393

commits

Python

primary language

Jul 12, 2026

updated

README

RS Nodes for ComfyUI

A comprehensive custom node pack for ComfyUI focused on LTXV audio-video generation, LoRA training, image generation, prompt engineering, and post-processing. Built for real-world production workflows with emphasis on VRAM efficiency and quality control.


Table of Contents


Installation

cd ComfyUI/custom_nodes
git clone https://github.com/richservo/rs-nodes.git
cd rs-nodes
install.bat

The install script handles everything: initializes the LTX-2 submodule (for LoRA training) and installs all Python dependencies.

Linux:

./install.sh

External Dependencies

  • Ollama — Required for RS Prompt Formatter and dataset captioning (RS LTXV Prepare Dataset). Install and run locally. The nodes auto-pull models on first use.
  • LTXV Models — The LTXV generation/extension nodes require LTXV model checkpoints and VAEs loaded through ComfyUI's standard model loading nodes.

Node Reference

All nodes appear under the RS Nodes category in ComfyUI's node menu.


Video Generation

RS LTXV Generate

All-in-one LTXV video generation with optional audio, keyframe injection, multimodal guidance, and integrated 2x latent upscaling.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive text conditioning
negativeCONDITIONINGNegative text conditioning
vaeVAEVideo VAE for encoding/decoding

Optional Inputs — Generation:

InputTypeDefaultDescription
widthINT768Generation width (step: 32)
heightINT512Generation height (step: 32)
num_framesINT97Frames to generate (step: 8). Auto-overridden by audio duration when audio + audio_vae are connected
stepsINT20Denoising steps
cfgFLOAT3.0Video classifier-free guidance scale
noise_seedINT0Random seed
seed_modeENUMrandomrandom, fixed, increment, decrement
frame_rateFLOAT25.0Video frame rate

Optional Inputs — Frame Injection:

InputTypeDefaultDescription
first_imageIMAGEKeyframe injected at frame 0
middle_imageIMAGEKeyframe injected at midpoint
last_imageIMAGEKeyframe injected at last frame
first_strengthFLOAT1.0Preservation strength (1.0 = exact match)
middle_strengthFLOAT1.0Preservation strength for middle frame
last_strengthFLOAT1.0Preservation strength for last frame
crfINT35LTXV preprocessing quality (0–100)

Optional Inputs — Audio (AV Dual-Tower):

InputTypeDefaultDescription
audioAUDIOInput audio (passthrough to output if provided)
audio_vaeVAEAudio VAE (enables AV dual-tower mode)
audio_cfgFLOAT7.0Audio CFG scale
stg_scaleFLOAT0.0Spatiotemporal guidance scale (0 = disabled)
stg_blocksSTRING"29"Comma-separated transformer block indices for STG
rescaleFLOAT0.7CFG rescaling factor

Optional Inputs — Efficiency:

InputTypeDefaultDescription
attention_modeENUMautoauto (SAGE if available), default, sage
ffn_chunksINT4FFN sequence chunking (0 = disabled)
video_attn_scaleFLOAT1.03Video attention scaling + VRAM-efficient forward

Optional Inputs — Upscale (2x Latent):

InputTypeDefaultDescription
upscaleBOOLEANFalseEnable 2x spatial upscaling
upscale_modelLATENT_UPSCALE_MODELLatent upscale model
upscale_stepsINT4Re-diffusion steps at upscaled resolution
upscale_cfgFLOAT1.0CFG during re-diffusion
upscale_denoiseFLOAT0.5Denoise strength (0 = no re-diffuse, 1 = full)

Outputs:

OutputTypeDescription
latentLATENTVideo latent [B, C, T, H, W]
audio_latentLATENTAudio latent (if audio_vae used)
imagesIMAGEDecoded video frames [B*T, H, W, C]
audio_outputAUDIOOutput audio (passthrough or decoded)

RS LTXV Extend

Extend an existing video with seamless temporal continuation using overlap blending.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
latentLATENTInput video latent to extend

Optional Inputs:

InputTypeDefaultDescription
num_new_framesINT80New frames to generate (step: 8)
overlap_framesINT16Frames of overlap for blending (step: 8)
stepsINT20Denoising steps
cfgFLOAT3.0Video CFG scale
last_imageIMAGEKeyframe for end of extension

Also accepts the same Audio, Efficiency, Upscale, and Scheduler inputs as RS LTXV Generate.

Outputs:

OutputTypeDescription
latentLATENTExtended video latent (original + new frames)
imagesIMAGEDecoded extension frames
audio_outputAUDIODecoded audio (if audio_vae used)

RS LTXV Upscale

Standalone 2x video upscaler with optional temporal upscaling and first-frame I2V re-diffusion.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
imagesIMAGEInput video frames

Optional Inputs:

InputTypeDefaultDescription
upscale_modelLATENT_UPSCALE_MODELSpatial 2x upscale model
temporal_upscale_modelLATENT_UPSCALE_MODELTemporal 2x upscale model
upscale_stepsINT4Re-diffusion steps
upscale_cfgFLOAT1.0CFG during re-diffusion
upscale_denoiseFLOAT0.5Denoise strength
upscale_loraENUMnoneLoRA for re-diffusion pass
attention_modeENUMautoAttention optimization
ffn_chunksINT4FFN chunking for memory

Outputs:

OutputTypeDescription
latentLATENTUpscaled video latent
imagesIMAGEDecoded upscaled frames
audio_outputAUDIOAudio passthrough

Key Behaviors:

  • Encodes input, applies spatial 2x via upscale model, re-diffuses with first-frame I2V guidance
  • Optional temporal 2x increases frame count before spatial upscaling
  • Tiled encoding/decoding for memory efficiency

Image Generation

RS Flux2 Generate

All-in-one Flux2.dev image generation with Kontext reference images, empirical mu scheduling, and optional two-pass latent upscaling.

Required Inputs:

InputTypeDescription
modelMODELFlux2 model
clipCLIPText encoder
vaeVAEImage VAE
promptSTRINGGeneration prompt

Optional Inputs:

InputTypeDefaultDescription
widthINT1024Image width
heightINT1024Image height
stepsINT50Sampling steps
guidanceFLOAT4.0Guidance scale
seedINT0Random seed
ref_image_1..4IMAGEUp to 4 Kontext reference images
loraENUMnoneLoRA adapter
attention_modeENUMautoAttention optimization
ffn_chunksINT4FFN chunking (double blocks only)
latent_upscaleENUMoffTwo-pass latent upscaling

Outputs:

OutputTypeDescription
imagesIMAGEGenerated image

Key Behaviors:

  • Kontext reference images auto-scaled to optimal aspect ratios and appended to conditioning
  • Empirical mu scheduling based on image dimensions
  • Optional two-pass: half-res first pass, then full-res re-diffusion

RS Z-Image Generate

All-in-one Z-Image Turbo generation with Qwen3-4B text encoder, RenormCFG, and system prompt support.

Required Inputs:

InputTypeDescription
modelMODELZ-Image Turbo model
clipCLIPQwen3-4B text encoder
vaeVAEImage VAE
promptSTRINGGeneration prompt

Optional Inputs:

InputTypeDefaultDescription
widthINT1024Image width
heightINT1024Image height
stepsINT10Sampling steps (4 for turbo)
system_promptENUMsuperiorSystem prompt variant
cfgFLOAT1.5CFG scale
renorm_cfgFLOAT1.0RenormCFG norm limit (0=off)
loraENUMnoneLoRA adapter

Outputs:

OutputTypeDescription
imagesIMAGEGenerated image

LoRA Training

RS LTXV Prepare Dataset

Scans a folder of videos/images, optionally detects and crops faces, identifies speakers by voice, generates captions via Ollama with woven-in dialogue, and preprocesses latents for LoRA training.

Required Inputs:

InputTypeDescription
media_folderSTRINGPath to folder of videos and/or images
model_pathCHECKPOINTLTX-2 checkpoint
text_encoder_pathSTRINGGemma-3 HF directory (auto-download available)
output_nameSTRINGName for preprocessed output folder

Optional Inputs — Captioning:

InputTypeDefaultDescription
resolution_bucketsSTRING"576x576x49"WxHxF resolution buckets (semicolon-separated)
lora_triggerSTRING""Trigger word prepended to all captions
caption_modeENUMollamaollama, skip, auto_filename
caption_styleENUMsubjectsubject, subject + style, style, motion, general, multi_character
ollama_modelSTRING"gemma4:26b"Vision model for captioning
skip_id_passBOOLEANFalseSkip cast/location ID pass — send all refs directly to captioner

Optional Inputs — Face Detection & Character ID:

InputTypeDefaultDescription
face_detectionBOOLEANTrueEnable InsightFace (antelopev2) face detection + ArcFace embedding
target_faceIMAGEReference face for single-character identity matching (uses lora_trigger as the character name)
character_refs_folderSTRING""Multi-character mode: folder of reference face images. Filename stem = character trigger
location_refs_folderSTRING""Location reference images folder
face_similarityFLOAT0.40Face match threshold
face_paddingFLOAT0.6Padding around detected face for face-crop mode
crop_modeENUMface_cropface_crop, pan_and_scan, full_frame

Optional Inputs — Speech Transcription & Voice Attribution:

InputTypeDefaultDescription
transcribe_speechBOOLEANFalseEnable Whisper transcription with Demucs vocal isolation
whisper_modelENUMlarge-v3Whisper model size (tiny/base/small/medium/large-v2/large-v3/large-v3-turbo)
voice_refs_folderSTRING""Folder of voice reference clips (audio OR video). Filename stem must match character_refs entries. Enables per-line speaker attribution via speechbrain ECAPA-TDNN

Optional Inputs — Other:

InputTypeDefaultDescription
target_fpsFLOAT0.0Target framerate (0 = source fps). Drops/keeps frames to match without affecting audio speed
max_samplesINT0Max total character appearances. Quotas split evenly across characters (e.g. max=200, 4 chars → 50 each)
skip_start_secondsFLOAT0.0Skip first N seconds of every video
skip_end_secondsFLOAT0.0Skip last N seconds of every video
conditioning_folderSTRING""IC-LoRA conditioning inputs folder
clipCLIPText encoder for in-process condition encoding
vaeVAEVAE for in-process latent encoding
clip_visionCLIP_VISIONOptional CLIP Vision model for matching non-human characters (puppets, props)

Outputs:

OutputTypeDescription
preprocessed_pathSTRINGPath to preprocessed data root
dataset_json_pathSTRINGPath to dataset JSON

Key Behaviors:

Extraction & Selection:

  • Two-phase processing: clip generation → latent preprocessing
  • Face detection via InsightFace (SCRFD + ArcFace, antelopev2 model pack)
  • Multi-character mode: drop face refs in character_refs_folder — auto-identifies cast per clip, balances quotas across characters
  • Location mode: separate folder for set/location references — Gemma matches location per clip
  • Pan & scan: face-aware cropping at any aspect ratio while keeping the face in frame
  • Frame-count safety: clip extraction always overshoots target frame count and trims, so clips never come up short of the bucket minimum
  • Incremental & resumable: per-clip atomic saves — interrupted runs continue from where they stopped; transcripts and conditions persist as they're generated
  • Quarantine, never delete: clips that fail (hallucination, no usable speech, no matching characters, etc.) move to <output_dir>/rejected_clips/<reason>/ instead of being deleted, so false positives can be reviewed and restored

Speech Transcription:

  • Demucs vocal isolation runs first to strip music/SFX before Whisper transcribes
  • Default model is large-v3 for best accuracy on character voices, accents, and unusual vocabulary; configurable down to tiny for quick tests
  • Silent clips get an empty transcript "" (recorded once, never re-attempted on subsequent runs)

Voice Attribution (when voice_refs_folder is set):

  • Each character's voice reference is embedded with speechbrain ECAPA-TDNN (192-d L2-normalized vector, downloaded automatically — no HuggingFace token needed)
  • For each Whisper segment in a clip, ECAPA produces a per-segment embedding that's matched against enrolled voice prints by cosine distance
  • Face-detection hint: the on-screen character (from face detection) gets a small distance bonus, biasing ambiguous matches toward the visible speaker without overriding strong off-screen voice evidence
  • Each segment is tagged with the matched character (or unknown for short utterances / unenrolled voices)
  • Tagged segments are passed to the captioner as a DIALOGUE CONTEXT block, and Gemma weaves the lines naturally into the caption ("X stands by the window and says, '...'") instead of appending dialogue as a separate field

Caption Encoding (in-process when clip is connected):

  • Captions stay clean in dataset.json (visual prose only — dialogue is woven in by the captioner)
  • At text-encode time, captions are normalized: quote-wrapping single quotes are stripped (so 'pee-wee' becomes pee-wee without affecting Pee-wee's or it's); known character names are case-normalized using the canonical trigger (so a stray Cowboy curd is from a Whisper mistranscription still encodes as Cowboy Curtis)
  • Original captions in dataset.json are never mutated — the normalization only affects the encoded .pt tensors

VRAM Management:

  • All prepper-loaded models (Whisper, Demucs, ECAPA-TDNN, InsightFace) are unloaded between phases, with a final unload sweep before prepare() returns so unattended workflows that follow with training start with a clean GPU

Voice Reference Files:

  • Format: any audio (.wav, .mp3, .flac, .m4a, .ogg, .opus) or video (.mp4, .mkv, .mov, .avi, .webm, .m4v) — audio is auto-extracted from video via ffmpeg
  • Naming: filename stem must match the character_refs_folder entry (e.g. cowboy curtis.wav matches cowboy curtis.jpg)
  • Length: 10-30 seconds of clean speech is the sweet spot; under 5 seconds risks unstable embeddings
  • Variety helps: different sentences/intonations beat one repeated phrase. Concatenating short clips of the same character with ffmpeg works fine — each character can be built from 4-6 short single-speaker clips spliced together
  • Demucs runs on enrollment too, so background music/effects in your reference clip get stripped automatically

RS LTXV Train LoRA

In-process LoRA training for LTX-2, reusing ComfyUI's already-loaded transformer. Includes a standalone training monitor that opens in a separate browser tab for full-size, resizable loss charts.

Required Inputs:

InputTypeDescription
modelMODELLTX-2 model (from CheckpointLoaderSimple)
output_nameSTRINGName for the output LoRA file
preprocessed_data_rootSTRINGPath from RS LTXV Prepare Dataset
model_pathCHECKPOINTLTX-2 checkpoint (for EmbeddingsProcessor/VAE)

Optional Inputs:

InputTypeDefaultDescription
vaeVAEVAE for validation (avoids loading from checkpoint)
presetENUMsubjectcustom, subject, style, motion, subject + style, all video, audio + video
lora_rankINT16LoRA rank
lora_alphaINT16LoRA alpha
8 module togglesBOOLEANvariesSelect which layers to train (self-attn, cross-attn, FFN, audio)
learning_rateFLOAT1e-4Learning rate
epochsINT3Number of passes through the full dataset
auto_stopBOOLEANFalseIgnore epoch count — train until divergence detection stops
optimizerENUMadamw8bitadamw8bit, adamw, or rose
rose_stabilizeBOOLEANTrueROSE only: CV Trust Gating (try False for some conditions)
schedulerENUMlinearLR schedule: linear, constant, cosine, cosine_with_restarts, polynomial
lr_cycle_stepsINT0LR schedule cycle length (0 = one cycle per epoch)
lr_cycle_decayFLOAT1.0Multiply LR by this factor each cycle reset (1.0 = no decay)
quantizationENUMfp8-quantofp8-quanto, int8-quanto, int4-quanto, none
strategyENUMtext_to_videotext_to_video or video_to_video (IC-LoRA)
clipCLIPText encoder for validation prompt
validation_promptSTRING""Prompt for validation video generation
validation_intervalINT250Steps between validations
checkpoint_intervalINT500Steps between checkpoints
diverge_detect_stepsINT150Steps above threshold before entering monitoring
diverge_stop_stepsINT300Steps in monitoring without recovery before stopping
diverge_thresholdFLOAT15.0% above lowest EMA loss to trigger divergence
resumeBOOLEANFalseResume from latest checkpoint

Outputs:

OutputTypeDescription
statusSTRINGTraining status message
lora_pathSTRINGPath to saved LoRA file

Key Behaviors:

  • In-process: reuses the loaded 22B transformer — no reload, no double memory
  • Training monitor: click "Open Training Monitor" on the node to open a full-page loss chart in a new browser tab. Shows raw loss dots, EMA-smoothed line, color-coded trend line, step timing, and divergence status. Loads history from loss_history.json on refresh.
  • ROSE optimizer: stateless optimizer — no momentum buffers, lower memory. ROSE-specific settings auto-hide when another optimizer is selected.
  • Divergence detection: monitors EMA loss vs minimum. If loss rises above threshold% for too long, saves a checkpoint and attempts LR reset. If unrecoverable, stops training and rewinds to the pre-divergence checkpoint.
  • LR cycle decay: progressive learning rate reduction across scheduler cycles (e.g., 0.9 = 10% reduction per cycle)
  • Loss history persistence: saves loss_history.json every 50 steps for chart continuity across resume/restart
  • Layer offloading: streams transformer blocks CPU↔GPU one at a time (~0.5 GB VRAM instead of ~11 GB)
  • FP8 quantization: reduces model memory while preserving LoRA weights in float
  • Resume support: restores optimizer state, RNG, loss history, and rebuilds LR schedule
  • Presets: auto-configure module toggles and rank for common use cases (subject, style, motion)
  • Quantization modifies the transformer in-place — reload checkpoint after training

Guidance & Control

RS IC-LoRA Guider

Structural control for LTXV using IC-LoRA (In-Context LoRA) with preprocessed control images.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
control_imageIMAGEPreprocessed control map (e.g., canny edges)
ic_loraENUMIC-LoRA safetensors file

Outputs:

OutputTypeDescription
guiderGUIDERConnect to the guider input of RS LTXV Generate

RS LTXV TTM Guider

Time-to-Move (TTM) motion control guider for LTXV. Enforces reference motion via dual-clock denoising with mask-based control.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
reference_videoIMAGEReference video for motion
maskIMAGEMotion mask (1.0 = enforce reference, 0.0 = free generation)

Optional Inputs:

InputTypeDefaultDescription
ttm_strengthFLOAT0.5Fraction of steps to apply TTM
cfgFLOAT3.0CFG scale
stg_scaleFLOAT0.0Spatiotemporal guidance

Outputs:

OutputTypeDescription
guiderGUIDERConnect to RS LTXV Generate's guider input
widthINTGeneration width
heightINTGeneration height

RS Canny Preprocessor

Canny edge detection with automatic LTXV-safe resolution (128-aligned).

Inputs:

InputTypeDefaultDescription
imageIMAGEInput image
widthINT768Target width (step: 128)
heightINT512Target height (step: 128)
low_thresholdINT100Canny low threshold
high_thresholdINT200Canny high threshold

Outputs:

OutputTypeDescription
imageIMAGEEdge map (grayscale to RGB)
widthINT128-aligned width
heightINT128-aligned height

Prompt Engineering

RS Prompt Parser

Parse structured dialogue scripts with [s]tyle, [a]ction, and [d]ialogue tags into separate video and audio prompts.

Inputs:

InputTypeDefaultDescription
scriptSTRING""Multiline script with tags
dialogue_modeENUMindividualindividual or all
dialogue_indexINT1Which dialogue line to select

Script Format:

[s] cinematic, natural lighting, handheld camera
[a] a man walks into a room and sits down
[d] Hello, how are you doing today?

Outputs:

OutputTypeDescription
video_promptSTRINGCombined visual prompt
audio_promptSTRINGTTS text
dialogue_countINTTotal dialogue segments
current_indexINTCurrent dialogue index
dialogue_listSTRINGNumbered list of all dialogue

RS Prompt Formatter

AI-powered prompt enhancement using a local Ollama model with reference image support and output caching.

Inputs:

InputTypeDefaultDescription
promptSTRING""Raw prompt to enhance
system_promptSTRING(built-in)Instructions for the model
modelSTRING"gemma3:12b"Ollama model name
reference_imageIMAGE(optional) Image for visual context

Outputs:

OutputTypeDescription
formatted_promptSTRINGEnhanced prompt text

Key Behaviors:

  • Streams responses from Ollama with live token printing
  • Auto-pulls missing models, strips <think> blocks
  • Caches prompt + output as JSON — skips Ollama when input unchanged

Requires: Ollama running locally.


RS Prompt Formatter Local

Ollama-free prompt formatter reusing Gemma3 12B from ComfyUI's DualCLIPLoader. Supports optional reference images via vision embeddings.

Inputs:

InputTypeDefaultDescription
text_encoderSTRINGGemma3 text encoder file
promptSTRING""Prompt to format
system_promptSTRINGSystem prompt for generation
first_imageIMAGE(optional) Opening image
middle_imageIMAGE(optional) Mid-scene image
last_imageIMAGE(optional) Ending image
max_tokensINT1024Maximum output tokens
temperatureFLOAT0.8Sampling temperature

Outputs:

OutputTypeDescription
formatted_promptSTRINGEnhanced prompt text

Key Behaviors:

  • No Ollama dependency — loads Gemma3 12B weights directly
  • Vision support for up to 3 reference images
  • JSON caching (text-only prompts)

Audio

RS Audio Concat

Concatenate up to 20 audio clips with per-clip trimming and configurable pauses.

Inputs: For each clip: audio file, start/end trim, pause after.

Outputs:

OutputTypeDescription
audioAUDIOConcatenated waveform

RS Audio Save

Export audio to disk with format selection (wav, flac, mp3, ogg).


RS MOSS TTS Loader

(Optional — requires transformers)

Load MOSS-TTS model variants for text-to-speech generation.


RS MOSS TTS Batch Save

(Optional — requires transformers)

Generate TTS audio from a dialogue list with automatic segmentation, per-clip trimming, and batch export. Supports one_shot, all, and single generation modes with Whisper-based word alignment.


Post-Processing & Utilities

RS Film Grain

Add realistic film grain with color variation and luminance-aware highlight protection.

Inputs:

InputTypeDefaultDescription
imagesIMAGEInput video frames
intensityFLOAT0.05Grain strength (0–1)
grain_sizeFLOAT1.5Grain frequency
color_amountFLOAT0.3Color noise ratio
highlight_protectionFLOAT0.5Protect bright/dark areas

Outputs:

OutputTypeDescription
imagesIMAGEGrained video frames

RS Video Trim

Trim video frames and/or audio by time range.

Inputs:

InputTypeDefaultDescription
fpsFLOAT24.0Frame rate
in_pointFLOAT0.0Start time (seconds)
out_pointFLOAT0.0End time (0 = end of clip)
imagesIMAGE(optional) Video frames
audioAUDIO(optional) Audio

Outputs:

OutputTypeDescription
imagesIMAGETrimmed frames
audioAUDIOTrimmed audio

RS Free VRAM

Passthrough utility that forces VRAM cleanup between pipeline stages.

InputTypeDescription
any_input* (wildcard)Any data — passed through unchanged

Unloads all models, runs garbage collection, clears CUDA cache.


RS Counter

Persistent incrementing counter. State stored in counter_state.json across workflow executions.

Inputs:

InputTypeDefaultDescription
startINT0Starting value (used on reset)
stepINT1Increment amount
resetBOOLEANFalseReset to start value

Outputs:

OutputTypeDescription
valueINTCurrent counter value (increments after output)

Workflow Examples

Basic LTXV Video Generation

[Load LTXV Model] ──┐
[CLIP Text Encode] ──┼──→ [RS LTXV Generate] ──→ [Save Video]
[CLIP Text Encode] ──┤
[Load VAE] ──────────┘

LoRA Training Pipeline

[Load LTXV Model] ──┐
[Load VAE] ──────────┼──→ [RS LTXV Prepare Dataset] ──→ [RS LTXV Train LoRA]
[Load CLIP] ─────────┘                                         │
                                                    (click "Open Training Monitor")

Audio-Driven Video with TTS

[RS Prompt Parser] ──→ [RS Prompt Formatter] ──→ [CLIP Text Encode] ──┐
        │                                                              │
        └──→ [RS MOSS TTS Loader] ──→ [RS MOSS TTS Batch Save] ──┐    │
                                              │                    │    │
                                      [RS Audio Concat] ──────────┼────┼──→ [RS LTXV Generate]

IC-LoRA Structural Control

[Load Image] ──→ [RS Canny Preprocessor] ──→ [RS IC-LoRA Guider] ──→ [RS LTXV Generate]

Video Extension + Upscale

[RS LTXV Generate] ──→ [RS LTXV Extend] ──→ [RS LTXV Upscale] ──→ [Save Video]

Tips & Troubleshooting

VRAM Management

  • Place RS Free VRAM between heavy inference nodes and post-processing to reclaim GPU memory.
  • Use ffn_chunks (default: 4) and video_attn_scale (default: 1.03) to reduce VRAM during generation.
  • Enable upscale_tiling for temporal tiling during upscale on long videos.
  • LoRA training uses layer offloading to stream blocks one at a time (~0.5 GB instead of ~11 GB).

Generation Quality

  • cfg: 2.5–4.0 works well for video; higher values can cause artifacts.
  • audio_cfg: 5.0–9.0 is typical for audio.
  • stg_scale: Start at 0. Small values (0.1–0.5) can improve temporal consistency.
  • rescale: 0.7 is a good default.
  • Upscaling: upscale_denoise=0.3–0.6 balances sharpness vs. faithfulness.

LoRA Training

  • Use fp8-quanto quantization (no C++ build tools needed).
  • Subject LoRAs: enable self-attention + cross-attention. Captions should describe everything except the subject.
  • Style LoRAs: enable self-attention + feed-forward. Captions should describe the visual style in detail.
  • ROSE optimizer: stateless, lower memory than AdamW. LR may need to be ~2x higher than AdamW (model-dependent — experiment).
  • Divergence detection: uses EMA loss distance from minimum. Threshold of 15% is a good default. Auto-saves checkpoint at detection, attempts LR reset, stops and rewinds if unrecoverable.
  • Resume: restores optimizer state, loss history, and LR schedule. The training monitor loads history from loss_history.json automatically.
  • Training Monitor: open via the link on the training node. Full-page chart with raw loss dots, EMA-smoothed line, trend line (green=decreasing, red=increasing), step timing, and divergence status. Resizes with the browser window.

Prompt Workflow

  • Write scripts with [s], [a], [d] tags and feed into RS Prompt Parser.
  • RS Prompt Formatter caches to JSON — if the input prompt hasn't changed, Ollama is skipped.
  • RS Prompt Formatter Local avoids Ollama entirely by loading Gemma3 12B directly.

License

See LICENSE for details.

Contributors

richservo

389 commits

claude

4 commits

richservo/rs-nodes

36

stars

393

commits

Python

primary language

Jul 12, 2026

updated

README

RS Nodes for ComfyUI

A comprehensive custom node pack for ComfyUI focused on LTXV audio-video generation, LoRA training, image generation, prompt engineering, and post-processing. Built for real-world production workflows with emphasis on VRAM efficiency and quality control.


Table of Contents


Installation

cd ComfyUI/custom_nodes
git clone https://github.com/richservo/rs-nodes.git
cd rs-nodes
install.bat

The install script handles everything: initializes the LTX-2 submodule (for LoRA training) and installs all Python dependencies.

Linux:

./install.sh

External Dependencies

  • Ollama — Required for RS Prompt Formatter and dataset captioning (RS LTXV Prepare Dataset). Install and run locally. The nodes auto-pull models on first use.
  • LTXV Models — The LTXV generation/extension nodes require LTXV model checkpoints and VAEs loaded through ComfyUI's standard model loading nodes.

Node Reference

All nodes appear under the RS Nodes category in ComfyUI's node menu.


Video Generation

RS LTXV Generate

All-in-one LTXV video generation with optional audio, keyframe injection, multimodal guidance, and integrated 2x latent upscaling.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive text conditioning
negativeCONDITIONINGNegative text conditioning
vaeVAEVideo VAE for encoding/decoding

Optional Inputs — Generation:

InputTypeDefaultDescription
widthINT768Generation width (step: 32)
heightINT512Generation height (step: 32)
num_framesINT97Frames to generate (step: 8). Auto-overridden by audio duration when audio + audio_vae are connected
stepsINT20Denoising steps
cfgFLOAT3.0Video classifier-free guidance scale
noise_seedINT0Random seed
seed_modeENUMrandomrandom, fixed, increment, decrement
frame_rateFLOAT25.0Video frame rate

Optional Inputs — Frame Injection:

InputTypeDefaultDescription
first_imageIMAGEKeyframe injected at frame 0
middle_imageIMAGEKeyframe injected at midpoint
last_imageIMAGEKeyframe injected at last frame
first_strengthFLOAT1.0Preservation strength (1.0 = exact match)
middle_strengthFLOAT1.0Preservation strength for middle frame
last_strengthFLOAT1.0Preservation strength for last frame
crfINT35LTXV preprocessing quality (0–100)

Optional Inputs — Audio (AV Dual-Tower):

InputTypeDefaultDescription
audioAUDIOInput audio (passthrough to output if provided)
audio_vaeVAEAudio VAE (enables AV dual-tower mode)
audio_cfgFLOAT7.0Audio CFG scale
stg_scaleFLOAT0.0Spatiotemporal guidance scale (0 = disabled)
stg_blocksSTRING"29"Comma-separated transformer block indices for STG
rescaleFLOAT0.7CFG rescaling factor

Optional Inputs — Efficiency:

InputTypeDefaultDescription
attention_modeENUMautoauto (SAGE if available), default, sage
ffn_chunksINT4FFN sequence chunking (0 = disabled)
video_attn_scaleFLOAT1.03Video attention scaling + VRAM-efficient forward

Optional Inputs — Upscale (2x Latent):

InputTypeDefaultDescription
upscaleBOOLEANFalseEnable 2x spatial upscaling
upscale_modelLATENT_UPSCALE_MODELLatent upscale model
upscale_stepsINT4Re-diffusion steps at upscaled resolution
upscale_cfgFLOAT1.0CFG during re-diffusion
upscale_denoiseFLOAT0.5Denoise strength (0 = no re-diffuse, 1 = full)

Outputs:

OutputTypeDescription
latentLATENTVideo latent [B, C, T, H, W]
audio_latentLATENTAudio latent (if audio_vae used)
imagesIMAGEDecoded video frames [B*T, H, W, C]
audio_outputAUDIOOutput audio (passthrough or decoded)

RS LTXV Extend

Extend an existing video with seamless temporal continuation using overlap blending.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
latentLATENTInput video latent to extend

Optional Inputs:

InputTypeDefaultDescription
num_new_framesINT80New frames to generate (step: 8)
overlap_framesINT16Frames of overlap for blending (step: 8)
stepsINT20Denoising steps
cfgFLOAT3.0Video CFG scale
last_imageIMAGEKeyframe for end of extension

Also accepts the same Audio, Efficiency, Upscale, and Scheduler inputs as RS LTXV Generate.

Outputs:

OutputTypeDescription
latentLATENTExtended video latent (original + new frames)
imagesIMAGEDecoded extension frames
audio_outputAUDIODecoded audio (if audio_vae used)

RS LTXV Upscale

Standalone 2x video upscaler with optional temporal upscaling and first-frame I2V re-diffusion.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
imagesIMAGEInput video frames

Optional Inputs:

InputTypeDefaultDescription
upscale_modelLATENT_UPSCALE_MODELSpatial 2x upscale model
temporal_upscale_modelLATENT_UPSCALE_MODELTemporal 2x upscale model
upscale_stepsINT4Re-diffusion steps
upscale_cfgFLOAT1.0CFG during re-diffusion
upscale_denoiseFLOAT0.5Denoise strength
upscale_loraENUMnoneLoRA for re-diffusion pass
attention_modeENUMautoAttention optimization
ffn_chunksINT4FFN chunking for memory

Outputs:

OutputTypeDescription
latentLATENTUpscaled video latent
imagesIMAGEDecoded upscaled frames
audio_outputAUDIOAudio passthrough

Key Behaviors:

  • Encodes input, applies spatial 2x via upscale model, re-diffuses with first-frame I2V guidance
  • Optional temporal 2x increases frame count before spatial upscaling
  • Tiled encoding/decoding for memory efficiency

Image Generation

RS Flux2 Generate

All-in-one Flux2.dev image generation with Kontext reference images, empirical mu scheduling, and optional two-pass latent upscaling.

Required Inputs:

InputTypeDescription
modelMODELFlux2 model
clipCLIPText encoder
vaeVAEImage VAE
promptSTRINGGeneration prompt

Optional Inputs:

InputTypeDefaultDescription
widthINT1024Image width
heightINT1024Image height
stepsINT50Sampling steps
guidanceFLOAT4.0Guidance scale
seedINT0Random seed
ref_image_1..4IMAGEUp to 4 Kontext reference images
loraENUMnoneLoRA adapter
attention_modeENUMautoAttention optimization
ffn_chunksINT4FFN chunking (double blocks only)
latent_upscaleENUMoffTwo-pass latent upscaling

Outputs:

OutputTypeDescription
imagesIMAGEGenerated image

Key Behaviors:

  • Kontext reference images auto-scaled to optimal aspect ratios and appended to conditioning
  • Empirical mu scheduling based on image dimensions
  • Optional two-pass: half-res first pass, then full-res re-diffusion

RS Z-Image Generate

All-in-one Z-Image Turbo generation with Qwen3-4B text encoder, RenormCFG, and system prompt support.

Required Inputs:

InputTypeDescription
modelMODELZ-Image Turbo model
clipCLIPQwen3-4B text encoder
vaeVAEImage VAE
promptSTRINGGeneration prompt

Optional Inputs:

InputTypeDefaultDescription
widthINT1024Image width
heightINT1024Image height
stepsINT10Sampling steps (4 for turbo)
system_promptENUMsuperiorSystem prompt variant
cfgFLOAT1.5CFG scale
renorm_cfgFLOAT1.0RenormCFG norm limit (0=off)
loraENUMnoneLoRA adapter

Outputs:

OutputTypeDescription
imagesIMAGEGenerated image

LoRA Training

RS LTXV Prepare Dataset

Scans a folder of videos/images, optionally detects and crops faces, identifies speakers by voice, generates captions via Ollama with woven-in dialogue, and preprocesses latents for LoRA training.

Required Inputs:

InputTypeDescription
media_folderSTRINGPath to folder of videos and/or images
model_pathCHECKPOINTLTX-2 checkpoint
text_encoder_pathSTRINGGemma-3 HF directory (auto-download available)
output_nameSTRINGName for preprocessed output folder

Optional Inputs — Captioning:

InputTypeDefaultDescription
resolution_bucketsSTRING"576x576x49"WxHxF resolution buckets (semicolon-separated)
lora_triggerSTRING""Trigger word prepended to all captions
caption_modeENUMollamaollama, skip, auto_filename
caption_styleENUMsubjectsubject, subject + style, style, motion, general, multi_character
ollama_modelSTRING"gemma4:26b"Vision model for captioning
skip_id_passBOOLEANFalseSkip cast/location ID pass — send all refs directly to captioner

Optional Inputs — Face Detection & Character ID:

InputTypeDefaultDescription
face_detectionBOOLEANTrueEnable InsightFace (antelopev2) face detection + ArcFace embedding
target_faceIMAGEReference face for single-character identity matching (uses lora_trigger as the character name)
character_refs_folderSTRING""Multi-character mode: folder of reference face images. Filename stem = character trigger
location_refs_folderSTRING""Location reference images folder
face_similarityFLOAT0.40Face match threshold
face_paddingFLOAT0.6Padding around detected face for face-crop mode
crop_modeENUMface_cropface_crop, pan_and_scan, full_frame

Optional Inputs — Speech Transcription & Voice Attribution:

InputTypeDefaultDescription
transcribe_speechBOOLEANFalseEnable Whisper transcription with Demucs vocal isolation
whisper_modelENUMlarge-v3Whisper model size (tiny/base/small/medium/large-v2/large-v3/large-v3-turbo)
voice_refs_folderSTRING""Folder of voice reference clips (audio OR video). Filename stem must match character_refs entries. Enables per-line speaker attribution via speechbrain ECAPA-TDNN

Optional Inputs — Other:

InputTypeDefaultDescription
target_fpsFLOAT0.0Target framerate (0 = source fps). Drops/keeps frames to match without affecting audio speed
max_samplesINT0Max total character appearances. Quotas split evenly across characters (e.g. max=200, 4 chars → 50 each)
skip_start_secondsFLOAT0.0Skip first N seconds of every video
skip_end_secondsFLOAT0.0Skip last N seconds of every video
conditioning_folderSTRING""IC-LoRA conditioning inputs folder
clipCLIPText encoder for in-process condition encoding
vaeVAEVAE for in-process latent encoding
clip_visionCLIP_VISIONOptional CLIP Vision model for matching non-human characters (puppets, props)

Outputs:

OutputTypeDescription
preprocessed_pathSTRINGPath to preprocessed data root
dataset_json_pathSTRINGPath to dataset JSON

Key Behaviors:

Extraction & Selection:

  • Two-phase processing: clip generation → latent preprocessing
  • Face detection via InsightFace (SCRFD + ArcFace, antelopev2 model pack)
  • Multi-character mode: drop face refs in character_refs_folder — auto-identifies cast per clip, balances quotas across characters
  • Location mode: separate folder for set/location references — Gemma matches location per clip
  • Pan & scan: face-aware cropping at any aspect ratio while keeping the face in frame
  • Frame-count safety: clip extraction always overshoots target frame count and trims, so clips never come up short of the bucket minimum
  • Incremental & resumable: per-clip atomic saves — interrupted runs continue from where they stopped; transcripts and conditions persist as they're generated
  • Quarantine, never delete: clips that fail (hallucination, no usable speech, no matching characters, etc.) move to <output_dir>/rejected_clips/<reason>/ instead of being deleted, so false positives can be reviewed and restored

Speech Transcription:

  • Demucs vocal isolation runs first to strip music/SFX before Whisper transcribes
  • Default model is large-v3 for best accuracy on character voices, accents, and unusual vocabulary; configurable down to tiny for quick tests
  • Silent clips get an empty transcript "" (recorded once, never re-attempted on subsequent runs)

Voice Attribution (when voice_refs_folder is set):

  • Each character's voice reference is embedded with speechbrain ECAPA-TDNN (192-d L2-normalized vector, downloaded automatically — no HuggingFace token needed)
  • For each Whisper segment in a clip, ECAPA produces a per-segment embedding that's matched against enrolled voice prints by cosine distance
  • Face-detection hint: the on-screen character (from face detection) gets a small distance bonus, biasing ambiguous matches toward the visible speaker without overriding strong off-screen voice evidence
  • Each segment is tagged with the matched character (or unknown for short utterances / unenrolled voices)
  • Tagged segments are passed to the captioner as a DIALOGUE CONTEXT block, and Gemma weaves the lines naturally into the caption ("X stands by the window and says, '...'") instead of appending dialogue as a separate field

Caption Encoding (in-process when clip is connected):

  • Captions stay clean in dataset.json (visual prose only — dialogue is woven in by the captioner)
  • At text-encode time, captions are normalized: quote-wrapping single quotes are stripped (so 'pee-wee' becomes pee-wee without affecting Pee-wee's or it's); known character names are case-normalized using the canonical trigger (so a stray Cowboy curd is from a Whisper mistranscription still encodes as Cowboy Curtis)
  • Original captions in dataset.json are never mutated — the normalization only affects the encoded .pt tensors

VRAM Management:

  • All prepper-loaded models (Whisper, Demucs, ECAPA-TDNN, InsightFace) are unloaded between phases, with a final unload sweep before prepare() returns so unattended workflows that follow with training start with a clean GPU

Voice Reference Files:

  • Format: any audio (.wav, .mp3, .flac, .m4a, .ogg, .opus) or video (.mp4, .mkv, .mov, .avi, .webm, .m4v) — audio is auto-extracted from video via ffmpeg
  • Naming: filename stem must match the character_refs_folder entry (e.g. cowboy curtis.wav matches cowboy curtis.jpg)
  • Length: 10-30 seconds of clean speech is the sweet spot; under 5 seconds risks unstable embeddings
  • Variety helps: different sentences/intonations beat one repeated phrase. Concatenating short clips of the same character with ffmpeg works fine — each character can be built from 4-6 short single-speaker clips spliced together
  • Demucs runs on enrollment too, so background music/effects in your reference clip get stripped automatically

RS LTXV Train LoRA

In-process LoRA training for LTX-2, reusing ComfyUI's already-loaded transformer. Includes a standalone training monitor that opens in a separate browser tab for full-size, resizable loss charts.

Required Inputs:

InputTypeDescription
modelMODELLTX-2 model (from CheckpointLoaderSimple)
output_nameSTRINGName for the output LoRA file
preprocessed_data_rootSTRINGPath from RS LTXV Prepare Dataset
model_pathCHECKPOINTLTX-2 checkpoint (for EmbeddingsProcessor/VAE)

Optional Inputs:

InputTypeDefaultDescription
vaeVAEVAE for validation (avoids loading from checkpoint)
presetENUMsubjectcustom, subject, style, motion, subject + style, all video, audio + video
lora_rankINT16LoRA rank
lora_alphaINT16LoRA alpha
8 module togglesBOOLEANvariesSelect which layers to train (self-attn, cross-attn, FFN, audio)
learning_rateFLOAT1e-4Learning rate
epochsINT3Number of passes through the full dataset
auto_stopBOOLEANFalseIgnore epoch count — train until divergence detection stops
optimizerENUMadamw8bitadamw8bit, adamw, or rose
rose_stabilizeBOOLEANTrueROSE only: CV Trust Gating (try False for some conditions)
schedulerENUMlinearLR schedule: linear, constant, cosine, cosine_with_restarts, polynomial
lr_cycle_stepsINT0LR schedule cycle length (0 = one cycle per epoch)
lr_cycle_decayFLOAT1.0Multiply LR by this factor each cycle reset (1.0 = no decay)
quantizationENUMfp8-quantofp8-quanto, int8-quanto, int4-quanto, none
strategyENUMtext_to_videotext_to_video or video_to_video (IC-LoRA)
clipCLIPText encoder for validation prompt
validation_promptSTRING""Prompt for validation video generation
validation_intervalINT250Steps between validations
checkpoint_intervalINT500Steps between checkpoints
diverge_detect_stepsINT150Steps above threshold before entering monitoring
diverge_stop_stepsINT300Steps in monitoring without recovery before stopping
diverge_thresholdFLOAT15.0% above lowest EMA loss to trigger divergence
resumeBOOLEANFalseResume from latest checkpoint

Outputs:

OutputTypeDescription
statusSTRINGTraining status message
lora_pathSTRINGPath to saved LoRA file

Key Behaviors:

  • In-process: reuses the loaded 22B transformer — no reload, no double memory
  • Training monitor: click "Open Training Monitor" on the node to open a full-page loss chart in a new browser tab. Shows raw loss dots, EMA-smoothed line, color-coded trend line, step timing, and divergence status. Loads history from loss_history.json on refresh.
  • ROSE optimizer: stateless optimizer — no momentum buffers, lower memory. ROSE-specific settings auto-hide when another optimizer is selected.
  • Divergence detection: monitors EMA loss vs minimum. If loss rises above threshold% for too long, saves a checkpoint and attempts LR reset. If unrecoverable, stops training and rewinds to the pre-divergence checkpoint.
  • LR cycle decay: progressive learning rate reduction across scheduler cycles (e.g., 0.9 = 10% reduction per cycle)
  • Loss history persistence: saves loss_history.json every 50 steps for chart continuity across resume/restart
  • Layer offloading: streams transformer blocks CPU↔GPU one at a time (~0.5 GB VRAM instead of ~11 GB)
  • FP8 quantization: reduces model memory while preserving LoRA weights in float
  • Resume support: restores optimizer state, RNG, loss history, and rebuilds LR schedule
  • Presets: auto-configure module toggles and rank for common use cases (subject, style, motion)
  • Quantization modifies the transformer in-place — reload checkpoint after training

Guidance & Control

RS IC-LoRA Guider

Structural control for LTXV using IC-LoRA (In-Context LoRA) with preprocessed control images.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
control_imageIMAGEPreprocessed control map (e.g., canny edges)
ic_loraENUMIC-LoRA safetensors file

Outputs:

OutputTypeDescription
guiderGUIDERConnect to the guider input of RS LTXV Generate

RS LTXV TTM Guider

Time-to-Move (TTM) motion control guider for LTXV. Enforces reference motion via dual-clock denoising with mask-based control.

Required Inputs:

InputTypeDescription
modelMODELLTXV diffusion model
positiveCONDITIONINGPositive conditioning
negativeCONDITIONINGNegative conditioning
vaeVAEVideo VAE
reference_videoIMAGEReference video for motion
maskIMAGEMotion mask (1.0 = enforce reference, 0.0 = free generation)

Optional Inputs:

InputTypeDefaultDescription
ttm_strengthFLOAT0.5Fraction of steps to apply TTM
cfgFLOAT3.0CFG scale
stg_scaleFLOAT0.0Spatiotemporal guidance

Outputs:

OutputTypeDescription
guiderGUIDERConnect to RS LTXV Generate's guider input
widthINTGeneration width
heightINTGeneration height

RS Canny Preprocessor

Canny edge detection with automatic LTXV-safe resolution (128-aligned).

Inputs:

InputTypeDefaultDescription
imageIMAGEInput image
widthINT768Target width (step: 128)
heightINT512Target height (step: 128)
low_thresholdINT100Canny low threshold
high_thresholdINT200Canny high threshold

Outputs:

OutputTypeDescription
imageIMAGEEdge map (grayscale to RGB)
widthINT128-aligned width
heightINT128-aligned height

Prompt Engineering

RS Prompt Parser

Parse structured dialogue scripts with [s]tyle, [a]ction, and [d]ialogue tags into separate video and audio prompts.

Inputs:

InputTypeDefaultDescription
scriptSTRING""Multiline script with tags
dialogue_modeENUMindividualindividual or all
dialogue_indexINT1Which dialogue line to select

Script Format:

[s] cinematic, natural lighting, handheld camera
[a] a man walks into a room and sits down
[d] Hello, how are you doing today?

Outputs:

OutputTypeDescription
video_promptSTRINGCombined visual prompt
audio_promptSTRINGTTS text
dialogue_countINTTotal dialogue segments
current_indexINTCurrent dialogue index
dialogue_listSTRINGNumbered list of all dialogue

RS Prompt Formatter

AI-powered prompt enhancement using a local Ollama model with reference image support and output caching.

Inputs:

InputTypeDefaultDescription
promptSTRING""Raw prompt to enhance
system_promptSTRING(built-in)Instructions for the model
modelSTRING"gemma3:12b"Ollama model name
reference_imageIMAGE(optional) Image for visual context

Outputs:

OutputTypeDescription
formatted_promptSTRINGEnhanced prompt text

Key Behaviors:

  • Streams responses from Ollama with live token printing
  • Auto-pulls missing models, strips <think> blocks
  • Caches prompt + output as JSON — skips Ollama when input unchanged

Requires: Ollama running locally.


RS Prompt Formatter Local

Ollama-free prompt formatter reusing Gemma3 12B from ComfyUI's DualCLIPLoader. Supports optional reference images via vision embeddings.

Inputs:

InputTypeDefaultDescription
text_encoderSTRINGGemma3 text encoder file
promptSTRING""Prompt to format
system_promptSTRINGSystem prompt for generation
first_imageIMAGE(optional) Opening image
middle_imageIMAGE(optional) Mid-scene image
last_imageIMAGE(optional) Ending image
max_tokensINT1024Maximum output tokens
temperatureFLOAT0.8Sampling temperature

Outputs:

OutputTypeDescription
formatted_promptSTRINGEnhanced prompt text

Key Behaviors:

  • No Ollama dependency — loads Gemma3 12B weights directly
  • Vision support for up to 3 reference images
  • JSON caching (text-only prompts)

Audio

RS Audio Concat

Concatenate up to 20 audio clips with per-clip trimming and configurable pauses.

Inputs: For each clip: audio file, start/end trim, pause after.

Outputs:

OutputTypeDescription
audioAUDIOConcatenated waveform

RS Audio Save

Export audio to disk with format selection (wav, flac, mp3, ogg).


RS MOSS TTS Loader

(Optional — requires transformers)

Load MOSS-TTS model variants for text-to-speech generation.


RS MOSS TTS Batch Save

(Optional — requires transformers)

Generate TTS audio from a dialogue list with automatic segmentation, per-clip trimming, and batch export. Supports one_shot, all, and single generation modes with Whisper-based word alignment.


Post-Processing & Utilities

RS Film Grain

Add realistic film grain with color variation and luminance-aware highlight protection.

Inputs:

InputTypeDefaultDescription
imagesIMAGEInput video frames
intensityFLOAT0.05Grain strength (0–1)
grain_sizeFLOAT1.5Grain frequency
color_amountFLOAT0.3Color noise ratio
highlight_protectionFLOAT0.5Protect bright/dark areas

Outputs:

OutputTypeDescription
imagesIMAGEGrained video frames

RS Video Trim

Trim video frames and/or audio by time range.

Inputs:

InputTypeDefaultDescription
fpsFLOAT24.0Frame rate
in_pointFLOAT0.0Start time (seconds)
out_pointFLOAT0.0End time (0 = end of clip)
imagesIMAGE(optional) Video frames
audioAUDIO(optional) Audio

Outputs:

OutputTypeDescription
imagesIMAGETrimmed frames
audioAUDIOTrimmed audio

RS Free VRAM

Passthrough utility that forces VRAM cleanup between pipeline stages.

InputTypeDescription
any_input* (wildcard)Any data — passed through unchanged

Unloads all models, runs garbage collection, clears CUDA cache.


RS Counter

Persistent incrementing counter. State stored in counter_state.json across workflow executions.

Inputs:

InputTypeDefaultDescription
startINT0Starting value (used on reset)
stepINT1Increment amount
resetBOOLEANFalseReset to start value

Outputs:

OutputTypeDescription
valueINTCurrent counter value (increments after output)

Workflow Examples

Basic LTXV Video Generation

[Load LTXV Model] ──┐
[CLIP Text Encode] ──┼──→ [RS LTXV Generate] ──→ [Save Video]
[CLIP Text Encode] ──┤
[Load VAE] ──────────┘

LoRA Training Pipeline

[Load LTXV Model] ──┐
[Load VAE] ──────────┼──→ [RS LTXV Prepare Dataset] ──→ [RS LTXV Train LoRA]
[Load CLIP] ─────────┘                                         │
                                                    (click "Open Training Monitor")

Audio-Driven Video with TTS

[RS Prompt Parser] ──→ [RS Prompt Formatter] ──→ [CLIP Text Encode] ──┐
        │                                                              │
        └──→ [RS MOSS TTS Loader] ──→ [RS MOSS TTS Batch Save] ──┐    │
                                              │                    │    │
                                      [RS Audio Concat] ──────────┼────┼──→ [RS LTXV Generate]

IC-LoRA Structural Control

[Load Image] ──→ [RS Canny Preprocessor] ──→ [RS IC-LoRA Guider] ──→ [RS LTXV Generate]

Video Extension + Upscale

[RS LTXV Generate] ──→ [RS LTXV Extend] ──→ [RS LTXV Upscale] ──→ [Save Video]

Tips & Troubleshooting

VRAM Management

  • Place RS Free VRAM between heavy inference nodes and post-processing to reclaim GPU memory.
  • Use ffn_chunks (default: 4) and video_attn_scale (default: 1.03) to reduce VRAM during generation.
  • Enable upscale_tiling for temporal tiling during upscale on long videos.
  • LoRA training uses layer offloading to stream blocks one at a time (~0.5 GB instead of ~11 GB).

Generation Quality

  • cfg: 2.5–4.0 works well for video; higher values can cause artifacts.
  • audio_cfg: 5.0–9.0 is typical for audio.
  • stg_scale: Start at 0. Small values (0.1–0.5) can improve temporal consistency.
  • rescale: 0.7 is a good default.
  • Upscaling: upscale_denoise=0.3–0.6 balances sharpness vs. faithfulness.

LoRA Training

  • Use fp8-quanto quantization (no C++ build tools needed).
  • Subject LoRAs: enable self-attention + cross-attention. Captions should describe everything except the subject.
  • Style LoRAs: enable self-attention + feed-forward. Captions should describe the visual style in detail.
  • ROSE optimizer: stateless, lower memory than AdamW. LR may need to be ~2x higher than AdamW (model-dependent — experiment).
  • Divergence detection: uses EMA loss distance from minimum. Threshold of 15% is a good default. Auto-saves checkpoint at detection, attempts LR reset, stops and rewinds if unrecoverable.
  • Resume: restores optimizer state, loss history, and LR schedule. The training monitor loads history from loss_history.json automatically.
  • Training Monitor: open via the link on the training node. Full-page chart with raw loss dots, EMA-smoothed line, trend line (green=decreasing, red=increasing), step timing, and divergence status. Resizes with the browser window.

Prompt Workflow

  • Write scripts with [s], [a], [d] tags and feed into RS Prompt Parser.
  • RS Prompt Formatter caches to JSON — if the input prompt hasn't changed, Ollama is skipped.
  • RS Prompt Formatter Local avoids Ollama entirely by loading Gemma3 12B directly.

License

See LICENSE for details.

Contributors

richservo

389 commits

claude

4 commits

Languages

Python

81.6%

JavaScript

8.9%

Shell

8.4%