Browse Source

add crop_first for all type of image prompts

feature/crop_first_image_prompts
oriBetelgeuse 4 years ago
parent
commit
bdce2eb56f
1 changed files with 3 additions and 7 deletions
  1. +3
    -7
      tests/test_image_prompts.py

+ 3
- 7
tests/test_image_prompts.py View File

@ -13,10 +13,6 @@ def test_image_prompts(sample_image, vae, borders, crop_first):
img = sample_image.copy()
img = img.resize((256, 256))
image_prompt = ImagePrompts(img, borders, vae, crop_first=crop_first)
if crop_first:
assert image_prompt.image_prompts.shape[1] == borders['up'] * 32
assert len(image_prompt.image_prompts_idx) == borders['up'] * 32
else:
assert image_prompt.image_prompts.shape[1] == 32 * 32
assert len(image_prompt.image_prompts_idx) == (borders['up'] + borders['down']) * 32 \
+ (borders['left'] + borders['right']) * (32 - borders['up'] - borders['down'])
assert image_prompt.image_prompts.shape[1] == 32 * 32
assert len(image_prompt.image_prompts_idx) == (borders['up'] + borders['down']) * 32 \
+ (borders['left'] + borders['right']) * (32 - borders['up'] - borders['down'])

Loading…
Cancel
Save