MCPcopy Create free account
hub / github.com/Lightricks/ComfyUI-LTXVideo / LTXVPerStepStatNormPatcher

Class LTXVPerStepStatNormPatcher

latent_norm.py:277–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275
276@comfy_node(name="LTXVPerStepStatNormPatcher")
277class LTXVPerStepStatNormPatcher(PerStepNormPatcher):
278 @classmethod
279 def INPUT_TYPES(s):
280 return {
281 "required": super().required()
282 | {
283 "target_mean": (
284 "FLOAT",
285 {
286 "default": 0.0,
287 "min": -10.0,
288 "max": 10.0,
289 "step": 0.01,
290 "round": 0.01,
291 },
292 ),
293 "target_std": (
294 "FLOAT",
295 {
296 "default": 1.0,
297 "min": 0.01,
298 "max": 10.0,
299 "step": 0.01,
300 "round": 0.01,
301 },
302 ),
303 "percentile": (
304 "FLOAT",
305 {
306 "default": 95.0,
307 "min": 50.0,
308 "max": 100.0,
309 "step": 0.1,
310 "round": 0.1,
311 "tooltip": "Percentile of distribution to use for statistics calculation",
312 },
313 ),
314 "clip_outliers": ("BOOLEAN", {"default": False}),
315 },
316 }
317
318 RETURN_TYPES = ("MODEL",)
319 FUNCTION = "patch_model"
320
321 CATEGORY = "Lightricks/latents"
322
323 def patch_model(
324 self, model, factors, target_mean, target_std, percentile, clip_outliers
325 ):
326 def cfg_stat_norm(latent, factor):
327 return LTXVStatNormLatent().statistical_normalize(
328 latent, target_mean, target_std, percentile, factor, clip_outliers
329 )
330
331 return self.patch_smooth_norm(model, factors, cfg_stat_norm)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected