aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/outpainting_mk_2.py
diff options
context:
space:
mode:
authorJairo Correa <jn.j41r0@gmail.com>2022-10-06 16:41:37 +0000
committerJairo Correa <jn.j41r0@gmail.com>2022-10-06 16:41:37 +0000
commitb66aa334a908cb8d760f2a65c1ebdf0cf336950a (patch)
tree9085640d50976eb26af3804683e60101ccb13d4a /scripts/outpainting_mk_2.py
parent82380d9ac18614c87bebba1b4cfd4b147cc76a18 (diff)
parent82eb8ea452b1e63535c58d15ec6db2ad2342faa8 (diff)
downloadstable-diffusion-webui-gfx803-b66aa334a908cb8d760f2a65c1ebdf0cf336950a.tar.gz
stable-diffusion-webui-gfx803-b66aa334a908cb8d760f2a65c1ebdf0cf336950a.tar.bz2
stable-diffusion-webui-gfx803-b66aa334a908cb8d760f2a65c1ebdf0cf336950a.zip
Merge branch 'master' into fix-vram
Diffstat (limited to 'scripts/outpainting_mk_2.py')
-rw-r--r--scripts/outpainting_mk_2.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/outpainting_mk_2.py b/scripts/outpainting_mk_2.py
index 11613ca3..a6468e09 100644
--- a/scripts/outpainting_mk_2.py
+++ b/scripts/outpainting_mk_2.py
@@ -85,8 +85,11 @@ def get_matched_noise(_np_src_image, np_mask_rgb, noise_q=1, color_variation=0.0
src_dist = np.absolute(src_fft)
src_phase = src_fft / src_dist
+ # create a generator with a static seed to make outpainting deterministic / only follow global seed
+ rng = np.random.default_rng(0)
+
noise_window = _get_gaussian_window(width, height, mode=1) # start with simple gaussian noise
- noise_rgb = np.random.random_sample((width, height, num_channels))
+ noise_rgb = rng.random((width, height, num_channels))
noise_grey = (np.sum(noise_rgb, axis=2) / 3.)
noise_rgb *= color_variation # the colorfulness of the starting noise is blended to greyscale with a parameter
for c in range(num_channels):