Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Has been cancelled
Execution Tests / test (macos-latest) (push) Has been cancelled
Execution Tests / test (ubuntu-latest) (push) Has been cancelled
Execution Tests / test (windows-latest) (push) Has been cancelled
Test server launches without errors / test (push) Has been cancelled
Unit Tests / test (macos-latest) (push) Has been cancelled
Unit Tests / test (ubuntu-latest) (push) Has been cancelled
Unit Tests / test (windows-2022) (push) Has been cancelled
Includes 30 custom nodes committed directly, 7 Civitai-exclusive loras stored via Git LFS, and a setup script that installs all dependencies and downloads HuggingFace-hosted models on vast.ai. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
"""
|
|
Tests for base image generation.
|
|
"""
|
|
|
|
import logging
|
|
from configs import DirectoryConfig
|
|
from tensor_utils import img_tensor_mae, blur
|
|
from io_utils import load_image
|
|
from fixtures_images import BASE_IMAGE_1, BASE_IMAGE_2
|
|
|
|
|
|
def test_base_image_matches_reference(base_image, test_dirs: DirectoryConfig):
|
|
"""
|
|
Verify generated base images match reference images.
|
|
This is just to check if the checkpoint and generation pipeline are as expected for the tests dependent on their behavior.
|
|
"""
|
|
logger = logging.getLogger("test_base_image_matches_reference")
|
|
image, _, _ = base_image
|
|
test_image_dir = test_dirs.test_images
|
|
im1 = image[0:1]
|
|
im2 = image[1:2]
|
|
|
|
test_im1 = load_image(test_image_dir / BASE_IMAGE_1)
|
|
test_im2 = load_image(test_image_dir / BASE_IMAGE_2)
|
|
|
|
# Reduce high-frequency noise differences with gaussian blur. Using perceptual metrics are probably overkill.
|
|
diff1 = img_tensor_mae(blur(im1), blur(test_im1))
|
|
diff2 = img_tensor_mae(blur(im2), blur(test_im2))
|
|
logger.info(f"Base Image Diff1: {diff1}, Diff2: {diff2}")
|
|
assert diff1 < 0.05, "Image 1 does not match its test image."
|
|
assert diff2 < 0.05, "Image 2 does not match its test image."
|