Browse by type
A ComfyUI nodes collection of utility and model patching functions. Also includes improved previewer that allows previewing batches during generation.
For recent user-visible changes, please see the ChangeLog.
BlehHyperTile node).BlehDeepShrink node).BlehDiscardPenultimateSigma node). This can be useful if you find certain samplers are ruining your image by spewing a bunch of noise into it at the very end (usually only an issue with dpm2 a or SDE samplers).add_noise is turned off in a sampler. Yes, that's right: if you don't have add_noise enabled no seed gets set for samplers like euler_a and it's not possible to reproduce generations. (look for the BlehForceSeedSampler node). For SamplerCustomAdvanced you can use BlehDisableNoise to accomplish the same thing.BlehGlobalSageAttention nodes.Copy either blehconfig.yaml.example to blehconfig.yaml and edit the copy. Bleh will also check for a blehconfig.json file when starting up if the YAML one doesn't exist. I recommend using YAML here.
Restart ComfyUI to apply any new changes.
There are links to the various TAE models used for high quality previewing near the bottom of this README.
BlehFixGuiderPreviewing node for LTX. See the description of it below.The previewer can now show visual previews for ACE-Steps (1.0 and 1.5) latents. If you want to disable that feature, you can add aceaudio to the
blacklist_formats list. For example if you are using a YAML configuration file you could do: blacklist_formats: ["aceaudio"]
General settings defaults:
| Key | Default | Description |
|---|---|---|
enabled |
true |
Toggles whether enhanced TAESD previews are enabled |
max_size |
768 |
Max width or height for previews. Note this does not affect TAESD decoding, just the preview image |
max_width |
max_size |
Same as max_size except allows setting the width independently. Previews may not work well with non-square max dimensions. |
max_height |
max_size |
Same as max_size except allows setting the height independently. Previews may not work well with non-square max dimensions. |
max_batch |
4 |
Max number of latents in a batch to preview |
max_batch_cols |
2 |
Max number of columns to use when previewing batches |
throttle_secs |
2 |
Max frequency to decode the latents for previewing. 0.25 would be every quarter second, 2 would be once every two seconds |
maxed_batch_step_mode |
false |
When false, you will see the first max_batch previews, when true you will see previews spread across the batch. Also applies to video frames. |
preview_device |
null |
null (use the default device) or a string with a PyTorch device name like "cpu", "cuda:0", etc. Can be used to run TAESD previews on CPU or other available devices. Not recommended to change this unless you really need to, using the CPU device may prevent out of memory errors but will likely significantly slow down generation. |
preview_dtype |
bfloat16 |
null (use the default device) or a string with a PyTorch dtype name like float32, bfloat16, float16 (probably the only ones that will work). |
compile_previewer |
false |
Controls whether the previewer gets compiled with torch.compile. May be a boolean or an object in which case the object will be used as argument to torch.compile. Note: May cause a delay/memory spike on the first preview. |
oom_fallback |
latent2rgb |
May be set to none or latent2rgb. Controls what happens if trying to decode the preview runs out of memory. |
oom_retry |
true |
If set to false, we will give up and use the oom_fallback behavior after hitting the first OOM. Otherwise, we'll attempt to decode with the normal previewer each time a preview is requested, even if that previously ran out of memory. |
whitelist_formats |
(empty list) | List of latent formats to whitelist. See example YAML config for more information. |
whitelist_formats |
(empty list) | List of latent formats to blacklist. See example YAML config for more information. |
Note: Most options here that refer to batches will also apply to video models and in that case frames will be treated like batch items. Batches aren't supported when generating videos.
Image model settings defaults:
| Key | Default | Description |
|---|---|---|
skip_upscale_layers |
0 |
The TAESD model has three upscale layers, each doubles the size of the result. Skipping some of them will significantly speed up TAESD previews at the cost of smaller preview image results. You can set this to -1 to automatically pop layers until at least one dimension is within the max width/height or -2 to aggressively pop until both dimensions are within the limit. |
More detailed explanation for skipping upscale layers: Latents (the thing you're running the TAESD preview on) are 8 times smaller than the image you get decoding by normal VAE or TAESD. The TAESD decoder has three upscale layers, each doubling the size: 1 * 2 * 2 * 2 = 8. So for example if normal decoding would get you a 1280x1280 image, skipping one TAESD upscale layer will get you a 640x640 result, skipping two will get you 320x320 and so on. I did some testing running TAESD decode on CPU for a 1280x1280 image: the base speed is about 1.95 sec base, 1.15 sec with one upscale layer skipped, 0.44 sec with two upscale layers skipped and 0.16 sec with all three upscale layers popped (of course you only get a 160x160 preview at that point). The upshot is if you are using TAESD to preview large images or batches or you want to run TAESD on CPU (normally pretty slow) you would probably benefit from setting skip_upscale_layers to 1 or 2. Also if your max preview size is 768 and you are decoding a 1280x1280 image, it's just going to get scaled down to 768x768 anyway.
Video model settings defaults:
| Key | Default | Description |
|---|---|---|
video_parallel |
false |
Use parallel mode when decoding video latents. May actually use more memory than a full VAE decode. |
video_max_frames |
-1 |
Maximum frames to include in a preview. Frame limiting is treated like batch limiting. -1 means unlimited. |
video_temporal_upscale_level |
0 |
Number of temporal upscale blocks to use, 0 will not do any temporal upscaling, 2 means full temporal upscaling. |
animate_preview |
none |
One of none, video, batch or both. Controls when animated previews are generated. When animating batch previews, batch items will be frames in the animation. |
These defaults are conservative. I would recommend setting throttle_secs to something relatively high (like 5-10) especially if you are generating batches at high resolution.
Slightly more detailed explanation for maxed_batch_step_mode: If max previews is set to 3 and the batch size is 15 you will see previews for indexes 0, 5, 10. Or to put it a different way, it steps through the batch by batch_size / max_previews rounded up. This behavior may be useful for previewing generations with a high batch count like when using AnimateDiff.
Last preview endpoint settings defaults:
The last preview endpoint will serve up either a webpage that auto-updates the last preview /bleh/last_preview.html or
a static image of the last preview /bleh/last_preview. It is disabled by default.
| Key | Default | Description |
|---|---|---|
publish_last_preview |
false |
Enables publishing last previews. |
publish_last_preview_min_refresh |
5 |
When auto updating last previews, it will occur at most every this many seconds. |
only_animate_last_preview |
true |
When enabled, animated previews only appear in the last preview endpoint, not the sampler. |
Last preview notes:
only_animate_last_preview on the default is reasonable. Unless you're using "Nodes 2.0", previews can't animate in the sampler so sending them just wastes resources.Note: Other node packs that patch ComfyUI's previewer behavior may interfere with this feature. One I am aware of is ComfyUI-VideoHelperSuite - if you have displaying animated previews turned on, it will overwrite Bleh's patched previewer. Or possibly, depending on the load order, Bleh will prevent it from working correctly.
Note: Very experimental.
This node takes a default model and a matched model. When the interval or start/end percentage match, the matched model will apply, otherwise the default one will. This can be used to apply something like HyperTile, Self Attention Guidance or other arbitrary model patches conditionally.
The first sampling step that matches the timestep range always applies matched, after that the following behavior applies: If the interval is positive then you just get matched every interval steps. It is also possible to set interval to a negative value, for example -3 would mean out of every three steps, the first two use matched and the third doesn't.
Notes and limitations: Not all types of model modifications/patches can be intercepted with a node like this. You also almost certainly can't use this to mix different models: both inputs should be instances of the same loaded model. It's also probably a bad idea to apply further patches on top of the BlehModelPatchConditional node output: it should most likely be the last thing before a sampler or something that actually uses the model.
Adds the ability to set a seed and timestep range that HyperTile gets applied for. Not well tested, and I just assumed the Inspire version works which may or may not be the case.
It is also possible to set an interval for HyperTile steps, this time it is just normal sampling steps that match the timestep range. The first sampling step that matches the timestep range always applies HyperTile, after that the following behavior applies: If the interval is positive then you just get HyperTile every interval steps. It is also possible to set interval to a negative value, for example -3 would mean out of every three steps, the first two have HyperTile and the third doesn't.
Note: Timesteps start from 999 and count down to 0 and also are not necessarily linear. Figuring out exactly which sampling step a timestep applies to is left as an exercise for you, dear node user. As an example, Karras and exponential samplers essentially rush to low timesteps and spend quite a bit of time there.
HyperTile credits:
The node was originally taken by Comfy from taken from: https://github.com/tfernd/HyperTile/
Then the Inspire node pack took it from the base ComfyUI node: https://github.com/ltdrdata/ComfyUI-Inspire-Pack
Then I took it from the Inspire node pack. The original license was MIT so I assume yoinking it into this repo is probably okay.
AKA PatchModelAddDownScale AKA Kohya Deep Shrink. Compared to the built-in Deep Shrink node this version has the following differences:
2,3 or 1,2,3.start_fadeout_percent input. When this is less than end_percent the downscale will be scaled to end at end_percent. For example, if downscale_factor=2.0, start_percent=0.0, end_percent=0.5 and start_fadeout_percent=0.0 then at 25% you could expect downscale_factor to be around 1.5. This is because we are deep shrinking between 0 and 50% and we are halfway through the effect range. (downscale_factor=1.0 would of course be a no-op and values below 1 don't seem to work.)$ claude mcp add ComfyUI-bleh \
-- python -m otcore.mcp_server <graph>