Diffusion Single File
comfyui

Added a better ComfyUI sampler based on the Cosmos-style RF sampling

#180
by Aizenzz - opened

A better ComfyUI sampler for Anima based on the Cosmos RF method

Hi everyone,

I made a ComfyUI sampler node for Anima:

https://github.com/KeithZ117/Comfyui-anima-sampler

The idea is to make Anima sampling closer to the RF inference style used in
Cosmos-style models, instead of relying only on the usual ComfyUI
sampler/scheduler combinations.

It includes:

  • FlowUniPC-style x0 solver
  • PC3 damped solver
  • RF linear shift schedule with shift 5
  • const CFG and ramp CFG modes
  • simpler default settings for daily use

The default profile is:

solver        = flow_unipc2_x0
schedule      = flow_rf_linear_shift
flow_shift    = 5.0
steps         = 35
cfg           = 7.0
cfg_mode      = const

In my testing, it works better than my previous sampler setup in several
areas:

  • better prompt / semantic adherence
  • more stable character-object relationships
  • stronger structure on complex compositions
  • cleaner detail retention
  • sampling behavior that feels more aligned with Cosmos-style RF inference

My current high-quality profile is:

solver        = flow_pc3_damped
schedule      = flow_rf_linear_shift
flow_shift    = 5.0
cfg           = 7.0
cfg_mode      = ramp cfg

comfyui_00005_

The prompt is:

masterpiece, best quality, score_7, safe, very aesthetic, ultra-detailed, high contrast, huge filesize, official art, hatsune miku, kagamine rin, hiramado miku, kowareta sekai to utaenai miku, project sekai, vocaloid, 2girls, full body, dynamic duo pose, floating, midair spin, synchronized motion, twisting torsos, arched backs, diagonal composition, foreshortening, Miku spinning backward in midair with one knee raised and one leg extended behind her, toes pointed, absurdly long twintails sweeping in a wide arc, one outstretched arm reaching toward Rin, other hand holding a large bouquet across her chest, Rin leaping upward from below, body tilted forward, one hand clasping Miku's reaching hand, other arm lifting a ribbon-wrapped bouquet, Rin's legs crossing in a dynamic kick, interlocked hands, crossing ribbons between them, bouquet passing between both girls, eye contact, head tilt, half-closed eyes, happy, closed mouth, smile, surprised smile, floating hair, hair between eyes, sidelocks, blue hair, blue eyes, blonde hair, orange eyes, pale_skin, fair_skin, detached sleeves, wide sleeves, elbow gloves, white gloves, bare shoulders, high collar, neck ribbon, striped ribbon, yellow ribbon, white ribbon, hair ribbon, hair ornament, x hair ornament, official alternate costume, official alternate hairstyle, gold trim, double horizontal stripe, blue theme, white theme, yellow theme, limited palette, pastel colors, pale color, dark, window, floating window, broken window frame, shattered glass, backlighting, rim light, light particles, bokeh, blurry background, depth of field, chromatic aberration, falling petals, white petals, floating object, flower, bouquet, baby's-breath, daisy \(flower\), lily \(flower\), white flower, basil leaf, olive, leaf, petals, ribbon trail, swirling ribbons, layered fabric, complex embroidery, lace trim, floral pattern, delicate cloth folds, cinematic lighting, soft glow
Aizenzz changed discussion title from Added a better ComfyUI sampler based on the Cosmos RF method to Added a better ComfyUI sampler based on the Cosmos-style RF sampling

That's interesting and neat i'll have to take a look at that, 'im learning more about ComfyUI because of my trainer wrapper :)

Seems to be erroring even with the example workflow.

ComfyUI Error Report

Error Details

  • Node ID: 7
  • Node Type: AnimaFlowCorrectiveSampler
  • Exception Type: TypeError
  • Exception Message: TypeError: fix_empty_latent_channels() takes from 2 to 3 positional arguments but 4 were given

Seems to be erroring even with the example workflow.

ComfyUI Error Report

Error Details

  • Node ID: 7
  • Node Type: AnimaFlowCorrectiveSampler
  • Exception Type: TypeError
  • Exception Message: TypeError: fix_empty_latent_channels() takes from 2 to 3 positional arguments but 4 were given

This bug is caused by an older version of ComfyUI. I have updated the plugin to add backward compatibility. You can try re-downloading my plugin or updating your ComfyUI.

Sign up or log in to comment