-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
145 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule comfyui-layerdiffuse
added at
c5f1c0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# test_horde.py | ||
|
||
from PIL import Image | ||
|
||
from hordelib.horde import HordeLib | ||
|
||
|
||
class TestHordeInferenceTransparent: | ||
def test_layerdiffuse_sd15( | ||
self, | ||
hordelib_instance: HordeLib, | ||
stable_diffusion_model_name_for_testing: str, | ||
): | ||
data = { | ||
"sampler_name": "k_euler", | ||
"cfg_scale": 8, | ||
"denoising_strength": 1.0, | ||
"seed": 1312, | ||
"height": 512, | ||
"width": 512, | ||
"karras": False, | ||
"tiling": False, | ||
"hires_fix": False, | ||
"transparent": True, | ||
"clip_skip": 1, | ||
"control_type": None, | ||
"image_is_control": False, | ||
"return_control_map": False, | ||
"prompt": "an ancient digital AI hydra monster###watermark, text", | ||
"ddim_steps": 25, | ||
"n_iter": 2, | ||
"model": stable_diffusion_model_name_for_testing, | ||
} | ||
image_results = hordelib_instance.basic_inference(data) | ||
|
||
assert len(image_results) == 2 | ||
|
||
img_pairs_to_check = [] | ||
|
||
img_filename_base = "layer_diffusion_sd15_n_iter_{0}.png" | ||
|
||
for i, image_result in enumerate(image_results): | ||
assert image_result.image is not None | ||
assert isinstance(image_result.image, Image.Image) | ||
|
||
img_filename = img_filename_base.format(i) | ||
|
||
image_result.image.save(f"images/{img_filename}", quality=100) | ||
img_pairs_to_check.append((f"images_expected/{img_filename}", image_result.image)) | ||
|
||
def test_layerdiffuse_sdxl( | ||
self, | ||
hordelib_instance: HordeLib, | ||
sdxl_refined_model_name: str, | ||
): | ||
data = { | ||
"sampler_name": "k_euler", | ||
"cfg_scale": 8, | ||
"denoising_strength": 1.0, | ||
"seed": 1312, | ||
"height": 1024, | ||
"width": 1024, | ||
"karras": False, | ||
"tiling": False, | ||
"hires_fix": False, | ||
"transparent": True, | ||
"clip_skip": 1, | ||
"control_type": None, | ||
"image_is_control": False, | ||
"return_control_map": False, | ||
"prompt": "an ancient digital AI hydra monster###watermark, text", | ||
"ddim_steps": 25, | ||
"n_iter": 2, | ||
"model": sdxl_refined_model_name, | ||
} | ||
|
||
image_results = hordelib_instance.basic_inference(data) | ||
|
||
assert len(image_results) == 2 | ||
|
||
img_pairs_to_check = [] | ||
|
||
img_filename_base = "layer_diffusion_sdxl_n_iter_{0}.png" | ||
|
||
for i, image_result in enumerate(image_results): | ||
assert image_result.image is not None | ||
assert isinstance(image_result.image, Image.Image) | ||
|
||
img_filename = img_filename_base.format(i) | ||
|
||
image_result.image.save(f"images/{img_filename}", quality=100) | ||
img_pairs_to_check.append((f"images_expected/{img_filename}", image_result.image)) |