summaryrefslogtreecommitdiffstats
path: root/pipelines
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2023-03-04 15:08:51 +0100
committerVolpeon <git@volpeon.ink>2023-03-04 15:08:51 +0100
commit220c842d22f282544e4d12d277a40f39f85d3c35 (patch)
tree6649e9603038d0e04a3f865712add5a6952ef81e /pipelines
parentUpdate (diff)
downloadtextual-inversion-diff-220c842d22f282544e4d12d277a40f39f85d3c35.tar.gz
textual-inversion-diff-220c842d22f282544e4d12d277a40f39f85d3c35.tar.bz2
textual-inversion-diff-220c842d22f282544e4d12d277a40f39f85d3c35.zip
Added Perlin noise to training
Diffstat (limited to 'pipelines')
-rw-r--r--pipelines/stable_diffusion/vlpn_stable_diffusion.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pipelines/stable_diffusion/vlpn_stable_diffusion.py b/pipelines/stable_diffusion/vlpn_stable_diffusion.py
index f02dd72..5f4fc38 100644
--- a/pipelines/stable_diffusion/vlpn_stable_diffusion.py
+++ b/pipelines/stable_diffusion/vlpn_stable_diffusion.py
@@ -22,7 +22,7 @@ from diffusers import (
22 PNDMScheduler, 22 PNDMScheduler,
23) 23)
24from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion import StableDiffusionPipelineOutput 24from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion import StableDiffusionPipelineOutput
25from diffusers.utils import logging, randn_tensor 25from diffusers.utils import logging
26from transformers import CLIPTextModel, CLIPTokenizer 26from transformers import CLIPTextModel, CLIPTokenizer
27 27
28from models.clip.util import unify_input_ids, get_extended_embeddings 28from models.clip.util import unify_input_ids, get_extended_embeddings
@@ -308,7 +308,7 @@ class VlpnStableDiffusion(DiffusionPipeline):
308 308
309 def prepare_image(self, batch_size, width, height, dtype, device, generator=None): 309 def prepare_image(self, batch_size, width, height, dtype, device, generator=None):
310 noise = perlin_noise( 310 noise = perlin_noise(
311 batch_size, width, height, res=1, octaves=4, generator=generator, dtype=dtype, device=device 311 batch_size, 1, width, height, res=1, octaves=4, generator=generator, dtype=dtype, device=device
312 ).expand(batch_size, 3, width, height) 312 ).expand(batch_size, 3, width, height)
313 return (1.4 * noise).clamp(-1, 1) 313 return (1.4 * noise).clamp(-1, 1)
314 314