Skip to content

Commit

Permalink
fix: assume default depth when depth is none
Browse files Browse the repository at this point in the history
  • Loading branch information
provos committed Jun 23, 2024
1 parent 4c66094 commit 2be3cf9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,12 +769,13 @@ def create_single_slice_request(n_clicks, filename, logs):
logs.append("No image available")
return no_update, no_update, no_update, logs, no_update

depth = 127
if state.slice_mask is None:
# create an empty image that the user can inpaint if they want to
image = Image.new('RGBA', state.imgData.size, (0, 0, 0, 0))
depth = 127
else:
depth = state.slice_pixel_depth
if state.slice_pixel is not None:
depth = state.slice_pixel_depth
image = create_slice_from_mask(
state.imgData, state.slice_mask, num_expand=EXPAND_MASK)

Expand Down

0 comments on commit 2be3cf9

Please sign in to comment.