Skip to content

Commit a4a4154

Browse files
committed
re-enable post-out-paint blending
1 parent 1776a66 commit a4a4154

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/g_diffuser_lib.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ def load_config():
185185
# try loading sampling defaults from the defaults.yaml file
186186
try:
187187
defaults = load_yaml(DEFAULT_PATHS.defaults_file)
188-
except:
189-
print("Warning: Could not load defaults file {0}".format(DEFAULT_PATHS.defaults_file))
188+
except Exception as e:
189+
print("Warning: Could not load defaults file {0} - {1}".format(DEFAULT_PATHS.defaults_file, e))
190190
defaults = {}
191191

192192
DEFAULT_SAMPLE_SETTINGS = argparse.Namespace()
@@ -666,9 +666,9 @@ def _reset_args(args):
666666
for path, artifact in grpc_samples:
667667
image = cv2.imdecode(np.fromstring(artifact.binary, dtype="uint8"), cv2.IMREAD_UNCHANGED)
668668

669-
#if not (mask_image is None): # blend original image back in for in/out-painting, this is required due to vae decoding artifacts
670-
# mask_rgb = 1.-gdl_utils.np_img_grey_to_rgb(mask_image/255.)
671-
# image = np.clip(image*(1.-mask_rgb) + init_image*mask_rgb, 0., 255.)
669+
if not (mask_image is None): # blend original image back in for in/out-painting, this is required due to vae decoding artifacts
670+
mask_rgb = 1.-gdl_utils.np_img_grey_to_rgb(mask_image/255.)
671+
image = np.clip(image*(1.-mask_rgb) + init_image*mask_rgb, 0., 255.)
672672

673673
if "annotation" in args: image = get_annotated_image(image, args)
674674

0 commit comments

Comments
 (0)