Skip to content

Commit

Permalink
add more info to the error message for AUTOMATIC1111#15567
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Apr 21, 2024
1 parent 367b823 commit 6f4f6bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/textual_inversion/image_embedding.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import base64
import json
import os.path
import warnings
import logging

Expand Down Expand Up @@ -117,7 +118,7 @@ def extract_image_data_embed(image):
outarr = crop_black(np.array(image.convert('RGB').getdata()).reshape(image.size[1], image.size[0], d).astype(np.uint8)) & 0x0F
black_cols = np.where(np.sum(outarr, axis=(0, 2)) == 0)
if black_cols[0].shape[0] < 2:
logger.debug('No Image data blocks found.')
logger.debug(f'{os.path.basename(getattr(image, "filename", "unknown image file"))}: no embedded information found.')
return None

data_block_lower = outarr[:, :black_cols[0].min(), :].astype(np.uint8)
Expand Down

0 comments on commit 6f4f6bf

Please sign in to comment.