ComfyUI Node

Inverted Pruning

A ComfyUI node in network_bending with 9 inputs and 1 output.

By DavidPiazza·Created about a year ago·Updated 8 months ago· 0
Inverted Pruning
  • model
  • model
pruning_modemagnitude_inverted
threshold0.10
target_layersall
preserve_functionality0.0
seed-1
gradient_accumulation_steps1
use_actual_gradientstrue
gradient_loss_typereconstruction
Categorynetwork_bending

Inputs (9)

NameTypeDefaultDescription
modelMODELThe model to apply inverted pruning to
pruning_modeCOMBOmagnitude_invertedType of inverted pruning to apply
thresholdFLOAT0.100–0.99Percentage of weights to remove (0.1 = remove top 10% most important)
target_layersSTRINGallComma-separated layer patterns (e.g., 'attention', 'conv', 'mlp')
preserve_functionalityFLOAT0.00–1How much to preserve base functionality (0=pure degradation, 1=mild effect)
seedINT-1-1–4294967295Random seed for reproducible pruning (-1 for random)
gradient_accumulation_stepsoptINT11–10Number of gradient accumulation steps for more stable importance estimation
use_actual_gradientsoptBOOLEANtrueUse actual gradient computation (slower but more accurate) or simplified method
gradient_loss_typeoptCOMBOreconstructionLoss function for gradient computation

Outputs (1)

NameTypeDescription
modelMODELModel with inverted pruning applied