diff options
author | Volpeon <git@volpeon.ink> | 2023-03-04 15:08:51 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2023-03-04 15:08:51 +0100 |
commit | 220c842d22f282544e4d12d277a40f39f85d3c35 (patch) | |
tree | 6649e9603038d0e04a3f865712add5a6952ef81e /pipelines | |
parent | Update (diff) | |
download | textual-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.py | 4 |
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 | ) |
24 | from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion import StableDiffusionPipelineOutput | 24 | from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion import StableDiffusionPipelineOutput |
25 | from diffusers.utils import logging, randn_tensor | 25 | from diffusers.utils import logging |
26 | from transformers import CLIPTextModel, CLIPTokenizer | 26 | from transformers import CLIPTextModel, CLIPTokenizer |
27 | 27 | ||
28 | from models.clip.util import unify_input_ids, get_extended_embeddings | 28 | from 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 | ||