MCPcopy Create free account
hub / github.com/blepping/ComfyUI-bleh / patch

Method patch

py/nodes/modelPatchConditional.py:336–361  ·  view source on GitHub ↗
(
        cls,
        *,
        model_default,
        model_matched=None,
        start_percent: float = 0.0,
        end_percent: float = 1.0,
        interval: int = 1,
        base_on_default: bool = True,
    )

Source from the content-addressed store, hash-verified

334
335 @classmethod
336 def patch(
337 cls,
338 *,
339 model_default,
340 model_matched=None,
341 start_percent: float = 0.0,
342 end_percent: float = 1.0,
343 interval: int = 1,
344 base_on_default: bool = True,
345 ):
346 if not model_matched or start_percent >= 1.0 or interval == 0:
347 return (model_default.clone(),)
348 mopts = getattr(model_default, "model_options", None)
349 if mopts is None or not isinstance(mopts, dict):
350 # Not an instance of ModelPatcher, apparently so we can't do anything here.
351 return (model_default.clone(),)
352 return (
353 ModelPatchConditional(
354 model_default,
355 model_matched,
356 start_percent,
357 end_percent,
358 interval,
359 base_on_default=base_on_default,
360 ).patch(),
361 )

Callers

nothing calls this directly

Calls 2

patchMethod · 0.45

Tested by

no test coverage detected