Skip to content

Commit

Permalink
feat: Support Stable Cascade Img2Img
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Mar 18, 2024
1 parent 5d7b6c3 commit 363e604
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ mediapipe>=0.9.1.0
unidecode
fuzzywuzzy
strenum
kornia
10 changes: 5 additions & 5 deletions tests/test_horde_inference_cascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_cascade_text_to_image_n_iter(

def test_cascade_image_to_image(
self,
stable_diffusion_model_name_for_testing: str,
stable_cascade_base_model_name: str,
hordelib_instance: HordeLib,
):
data = {
Expand All @@ -120,17 +120,17 @@ def test_cascade_image_to_image(
"control_type": None,
"image_is_control": False,
"return_control_map": False,
"prompt": "a medieval fantasy swashbuckler with a big floppy hat",
"prompt": "A predatory dinosaur sitting on its prey",
"ddim_steps": 20,
"n_iter": 1,
"model": stable_diffusion_model_name_for_testing,
"source_image": Image.open("images/test_db0.jpg"),
"model": stable_cascade_base_model_name,
"source_image": Image.open("images/test_inpaint_original.png"),
"source_processing": "img2img",
}
pil_image = hordelib_instance.basic_inference_single_image(data).image
assert pil_image is not None
assert isinstance(pil_image, Image.Image)
assert pil_image.size == (512, 512)
assert pil_image.size == (1024, 1024)

img_filename = "stable_cascade_image_to_image.png"
pil_image.save(f"images/{img_filename}", quality=100)
Expand Down

0 comments on commit 363e604

Please sign in to comment.