Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
367b8234
Commit
367b8234
authored
Apr 21, 2024
by
AUTOMATIC1111
Committed by
GitHub
Apr 21, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15567 from AUTOMATIC1111/no-image-data-blocks-debug
Hide 'No Image data blocks found.' message
parents
c8ac42aa
d212fb59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
modules/textual_inversion/image_embedding.py
modules/textual_inversion/image_embedding.py
+4
-1
No files found.
modules/textual_inversion/image_embedding.py
View file @
367b8234
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment