Skip to content

u/zyg_AI

In this archive from Jan 2026 to Dec 2026

2
posts
639
comments
14
media
1.6k
score
1 saved before deletion

You can check your model with

head -c 4 Qwen-Image-2.1-Turbo-Uncensored-AD-Q6_K.gguf

The output should be GGUF

The error points to a faulty model or outdated loader node.

1 points

Several people have developped apps to connect to comfyUI via API, network hook, or even use comfyUI natively on mobile phone.

Search this subreddit with the keyword "mobile" or similar, sort by NEW.

1 points

u/Greedy_Cow9889
Well, I had time to read your comment before it got deleted (no idea why BTW).

Here is the answer I planned to send:

Great answer comrade, thanx a lot. I have so many questions right now, but I'll keep that for later. For now I'm gonna benchmark it on my Linux + 3090 + 64GB DDR5. I will post the results.

Keep it on 👍

2 points

I'm very interested yet curious about how it works and the process that led you to build it.

I've had a chat with chatGPT, to explain the optimization techniques used and the trade-offs. It was a bit long but interesting. Did chatGPT get it right?

Here is the summary, for those interested:

NoiraDEVILNodes is an experimental acceleration suite for running the original 66.28 GB BF16 MiniMax H3 diffusion model in ComfyUI on consumer GPUs.
It combines four main optimization techniques:

Guarded residual caching
Adaptive weight read-ahead
Exact AdaLN optimization
Sparse attention

These techniques target different bottlenecks: redundant computation, CPU-to-GPU weight transfers, repeated modulation calculations and expensive attention operations.

## 1. Guarded Residual Caching

**Purpose:** Avoid repeatedly executing the expensive diffusion transformer.

Normally, every diffusion step evaluates the transformer using the current latent and timestep to calculate a new prediction.
Residual caching reuses a previously calculated prediction instead of running the entire transformer again.
Importantly, a cache hit does NOT mean the diffusion step becomes a no-op. The sampler still advances the latent using the current timestep and the cached prediction.

In simplified form:
- Normal sampling: calculate a new prediction at every step.
- Cached sampling: reuse a previous prediction for selected steps.
- The latent continues evolving throughout the process.
The implementation uses safeguards such as residual thresholds, temporal guards, restrictions on consecutive cache hits and schedule boundaries.

**Benefits:**

- Potentially the largest reduction in computation.
- Avoids complete transformer evaluations.
- Also avoids transferring weights for skipped transformer blocks.
- Particularly attractive for very large models.

**Trade-offs:**

- Reused predictions are approximations of the current predictions.
- Errors can accumulate across successive diffusion steps.
- Potential degradation of fine details, character identity, motion and temporal consistency.
- A cache threshold does not guarantee perceptual equivalence.
- The resulting video may differ from ordinary dense sampling.
**Assessment:** Potentially very effective, but one of the riskiest optimizations for output fidelity. Conservative caching should be preferred initially.

## 2. Adaptive Weight Read-Ahead

**Purpose:** Reduce GPU waiting time caused by transferring model weights from system RAM to VRAM.
The complete BF16 model is approximately 66.28 GB, considerably larger than the VRAM of consumer GPUs.
Consequently, model weights must be streamed between system RAM and GPU memory.

A naive implementation loads each layer only when it is needed, potentially leaving the GPU waiting for transfers.
Adaptive read-ahead anticipates which transformer blocks will be required and stages their weights in advance.

It uses mechanisms such as:
- Pinned host memory.
- Prefetch queues.
- GPU memory budgets.
- Overlapping weight transfers with GPU computation.
- Memory reserves to prevent allocation failures.
**Benefits:**
- Reduces transfer-related waiting time.
- Improves GPU utilization.
- Does not inherently alter model calculations or output quality.
- Particularly valuable when running models larger than available VRAM.
**Trade-offs:**
- Consumes additional system RAM.
- Pinned memory reduces the flexibility of the operating system's memory manager.
- Requires sufficient PCIe bandwidth.
- Poorly configured prefetching can cause RAM or VRAM exhaustion.
- Introduces synchronization and memory-management complexity.
**Assessment:** One of the safest optimizations from a quality perspective. Particularly interesting for GPUs with limited VRAM, provided sufficient system RAM and PCIe bandwidth are available.

## 3. Exact AdaLN Optimization

**Purpose:** Eliminate redundant timestep-dependent calculations.

AdaLN (Adaptive Layer Normalization) uses modulation parameters to control how transformer blocks process their inputs.
Some of these calculations depend on the timestep and model parameters rather than the changing video latent.
For a known sampling schedule, the required modulation tensors can therefore be precomputed and reused.
The implementation calculates these values ahead of sampling and stores them for subsequent retrieval.
The important distinction is that this is intended to be an exact optimization, not an approximation.

The implementation checks bitwise parity between the native computation and the precomputed results before enabling the optimization.

**Benefits:**

- Avoids repeated projection calculations.
- Reduces unnecessary computation during sampling.
- Reduces the need to repeatedly load associated projection weights.
- Should not degrade output quality when exact parity is maintained.

**Trade-offs:**

- Requires additional CPU memory.
- Introduces initialization overhead.
- Depends on the sampling schedule.
- Requires compatibility with the expected model architecture and execution path.
- Changes to upstream model internals can invalidate implementation assumptions.
**Assessment:** Probably the most attractive optimization. It removes redundant work without intentionally sacrificing numerical accuracy.

## 4. Sparse Attention

**Purpose:** Reduce the computational cost of attention.

Attention allows video tokens to exchange information with other tokens, establishing spatial and temporal relationships.
Dense attention calculates all relevant token interactions. Its computational and memory costs increase substantially with sequence length.
Sparse attention deliberately reduces the number of interactions.
The Noira implementation uses a reduced video-attention budget during selected portions of the sampling schedule, while retaining denser attention for certain conditioning and boundary operations.

The reported configuration uses a 15% video-attention budget during the middle of sampling, with denser attention at the beginning and end.

**Benefits:**

- Reduces attention computation.
- Can significantly improve performance on long video sequences.
- Particularly useful when attention becomes a major computational bottleneck.

**Trade-offs:**

- Some token interactions are no longer calculated.
- May reduce prompt adherence.
- Can affect character identity and appearance.
- May degrade motion coherence and interactions between characters.
- Can introduce spatial or temporal inconsistencies.
- The optimal attention budget may depend on the prompt and scene.
**Assessment:** Potentially useful, but quality-sensitive. Aggressive sparsity should be avoided until its effects have been evaluated on representative videos.

## 5. How the Optimizations Complement Each Other

The four techniques attack different bottlenecks:

| Optimization | Primary target |

| -------------------------- | --------------------------------- |
| Guarded residual caching | Redundant transformer execution |
| Adaptive weight read-ahead | CPU-to-GPU transfer latency |
| Exact AdaLN | Redundant modulation calculations |
| Sparse attention | Attention computation |

Their combined effect can be greater than their individual contributions because they reinforce one another.

For example, residual caching avoids executing transformer blocks and consequently avoids transferring their weights. Adaptive read-ahead then focuses on the smaller number of executions that remain.
However, their speed gains cannot simply be added together. As one bottleneck is reduced, another may become dominant.
Combining multiple optimizations also makes quality problems more difficult to diagnose.

## 6. Overall Assessment

Technique Quality risk Main cost
Exact AdaLN Very low, when parity is verified CPU memory and initialization
Adaptive weight read-ahead Very low, when implemented correctly System RAM and PCIe bandwidth
Guarded residual caching Medium to high Numerical approximation
Sparse attention Medium to high Reduced information exchange

### Preferred approach

Prioritize optimizations that eliminate redundant work without changing the model's mathematical behaviour:

Exact AdaLN.
Adaptive weight read-ahead.
Conservative guarded residual caching.
Sparse attention only if additional acceleration is necessary.

The ideal outcome would be to obtain substantial performance improvements through exact computation reuse and better memory management, while minimizing approximations that could compromise video quality.

**The key distinction:**
A faster generation is not necessarily an equivalent generation. The real objective should be to maximize speed while preserving the visual quality, character consistency and temporal coherence of the original MiniMax H3 model.

2 points

Actually, that is totally part of "getting the hang" 😜 .

You seem eager to learn. Generative AI in general and ComfyUI in particular are full of micro and macro concepts. It's a rabbit-hole elephant-hole. Start with the basics, Pixaroma is the usually recommended tuto maker to follow (for good reasons) but there are others around (foxfuressence for example).

Illustrious is a good starting point. Understand the classic workflow pattern (model / clip / VAE -> lora -> CLIP encode -> sampler -> decode -> output) and what each node is there for.

(And you're not prepared for the esoteric language people in this subreddit use)

1 points

Spot on 👍 - Use 'preview image' first. Save image when you're happy with the result. Or save them all and sort later.

This node takes width and height as input
There are other nodes which upscale by a factor or to a total number of pixels. Double click the canvas and type 'upscale'. Pick what you prefer.

https://i.redd.it/g6f6vynmh84i1.png

2 points

Thanx for taking the time.
For me it is still a bijection when dequantizing, no new data.

We effectively convert INT8 to FP32, but the FP32 precision is lost. Only specific values of the FP32 are allowed, with unreachable intervals in between.

My IT and maths degrees are long gone, and friday nights don't help, so hit me (or ignore me) if I'm nitpicking.

1 points

It seems OK. I misunderstood your issue, I thought every model was failing. If only 3 fail, it may be because they are turbo models (turbo lora merged into it). Try 8 steps and CFG 1 and see if that fixes it.
Other option is that the model download failed, but it had to happen 3 times. Unlikely but possible.

Even without Turbo, CFG 6 is high (but fine) and 34 steps can be lowered to 20-ish without quality loss.

2 points

There is no gain that I can see in doing it within comfyUI.
Of course we could, but
- comfy's big disadvantage is that the settings are scattered all throughout the graph
- comfy's strength of finely adjusting workflows is kinda irrelevant there - a monolithic program is better suited.

Or maybe I'm totally wrong and it's just that the community took the habit of using other programs.

EDIT: and because fizgig is great.

9 points

Yep, CFG is an interesting concept overall.

MOSS also has a Skip Layer Guidance (SLG) mechanism on top of that, but I have no idea what's the effect on NEG. I haven't tried myself (yet).

1 points

There a trick you can try: set the CFG to 0, it should generate an image based on your negative prompt only.
Important, use the base checkpoint, not a distilled.

Quick explanation:
CW is the conditioning weight, NEG is the negative cond (prompt), POS is the positive cond (prompt)

CW = NEG + CFG x (POS - NEG)

With CFG = 1:
CW = NEG + POS - NEG = POS <-- only POS in the result

With CFG = 0:
CW = NEG + 0 x (POS - NEG) = NEG <-- only NEG in the result

4 points

Delete this file

comfyui/user/comfyui.log

Start comfyUI, then provide the file ⬆️ (comfyui.log) on pastebin, google drive, anything convenient for you. This will give some context.

1 points

Je ne sais pas, je n'ai pas vraiment creusé la question. C'est sûr que c'est pas un cas d'usage ultra répandu, mais si c'est possible, quelqu'un l'a peut-etre déjà fait. A mon avis, il ne faut pas s'attendre a des résultats incroyables du premier coup.
Une façon d'aborder les choses serait de générer en 180° directement plutôt que de passer par une conversion.

Je jetterai un coup d'oeil sur le sujet un de ces jours.
😝

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.