Skip to content

Commit 367b823

Browse files
Merge pull request AUTOMATIC1111#15567 from AUTOMATIC1111/no-image-data-blocks-debug
Hide 'No Image data blocks found.' message
2 parents c8ac42a + d212fb5 commit 367b823

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/textual_inversion/image_embedding.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import base64
22
import json
33
import warnings
4+
import logging
45

56
import numpy as np
67
import zlib
78
from PIL import Image, ImageDraw
89
import torch
910

11+
logger = logging.getLogger(__name__)
12+
1013

1114
class EmbeddingEncoder(json.JSONEncoder):
1215
def default(self, obj):
@@ -114,7 +117,7 @@ def extract_image_data_embed(image):
114117
outarr = crop_black(np.array(image.convert('RGB').getdata()).reshape(image.size[1], image.size[0], d).astype(np.uint8)) & 0x0F
115118
black_cols = np.where(np.sum(outarr, axis=(0, 2)) == 0)
116119
if black_cols[0].shape[0] < 2:
117-
print('No Image data blocks found.')
120+
logger.debug('No Image data blocks found.')
118121
return None
119122

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

0 commit comments

Comments
 (0)