Commit 367b8234 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub

Merge pull request #15567 from AUTOMATIC1111/no-image-data-blocks-debug

Hide 'No Image data blocks found.' message
parents c8ac42aa d212fb59
import base64
import json
import warnings
import logging
import numpy as np
import zlib
from PIL import Image, ImageDraw
import torch
logger = logging.getLogger(__name__)
class EmbeddingEncoder(json.JSONEncoder):
def default(self, obj):
......@@ -114,7 +117,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:
print('No Image data blocks found.')
logger.debug('No Image data blocks found.')
return None
data_block_lower = outarr[:, :black_cols[0].min(), :].astype(np.uint8)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment