Detail declared no traits, which read as "works on everything" and meant "is offered on everything and drops itself on half of them". Core's unsharp mask pads in two dimensions and raises on anything with more, so on a model with a time axis the toggle was present, switchable, and inert -- a knob that does nothing, which is the fault this project has shipped once already. It now declares spatial_latent and is absent where it cannot work. The guard's regression case survives, because the guard is not about a module being wrong about itself: a hook meets the tensor it was handed. The stub model now announces a latent rank, without which every trait-declaring modifier was filtered out and those tests passed by installing nothing at all. Round seven, one finding, confirmed in part -- the maths is deliberately not being fixed, the advertisement was the defect.
45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
"""Stub models for the sampling tests.
|
|
|
|
A patcher whose model announces nothing offers no traits, and every modifier
|
|
that declares one is then filtered out -- so a test using a bare stub would pass
|
|
by installing nothing at all and prove the opposite of what it says. The stubs
|
|
here announce a latent rank, which is the trait modifiers actually narrow on.
|
|
"""
|
|
|
|
import pytest
|
|
|
|
|
|
def patcher_reporting(latent_dimensions):
|
|
import torch
|
|
from comfy.model_patcher import ModelPatcher
|
|
|
|
class Format:
|
|
pass
|
|
|
|
class Config:
|
|
pass
|
|
|
|
class Stub(torch.nn.Module):
|
|
pass
|
|
|
|
stub = Stub()
|
|
fmt = Format()
|
|
fmt.latent_dimensions = latent_dimensions
|
|
config = Config()
|
|
config.latent_format = fmt
|
|
stub.model_config = config
|
|
return ModelPatcher(stub, load_device=torch.device("cpu"),
|
|
offload_device=torch.device("cpu"))
|
|
|
|
|
|
@pytest.fixture
|
|
def patcher(comfyui):
|
|
"""A model with a two-axis latent: what an image model reports."""
|
|
return patcher_reporting(2)
|
|
|
|
|
|
@pytest.fixture
|
|
def temporal_patcher(comfyui):
|
|
"""A model with a time axis."""
|
|
return patcher_reporting(3)
|