File tree 1 file changed +4
-1
lines changed
modules/textual_inversion
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
import base64
2
2
import json
3
3
import warnings
4
+ import logging
4
5
5
6
import numpy as np
6
7
import zlib
7
8
from PIL import Image , ImageDraw
8
9
import torch
9
10
11
+ logger = logging .getLogger (__name__ )
12
+
10
13
11
14
class EmbeddingEncoder (json .JSONEncoder ):
12
15
def default (self , obj ):
@@ -114,7 +117,7 @@ def extract_image_data_embed(image):
114
117
outarr = crop_black (np .array (image .convert ('RGB' ).getdata ()).reshape (image .size [1 ], image .size [0 ], d ).astype (np .uint8 )) & 0x0F
115
118
black_cols = np .where (np .sum (outarr , axis = (0 , 2 )) == 0 )
116
119
if black_cols [0 ].shape [0 ] < 2 :
117
- print ('No Image data blocks found.' )
120
+ logger . debug ('No Image data blocks found.' )
118
121
return None
119
122
120
123
data_block_lower = outarr [:, :black_cols [0 ].min (), :].astype (np .uint8 )
You can’t perform that action at this time.
0 commit comments