(self, p: processing.StableDiffusionProcessing, *args, **_kwargs)
| 30 | p.generator = generator if p.subseed_strength <= 0.5 else var_generator |
| 31 | |
| 32 | def process_batch(self, p: processing.StableDiffusionProcessing, *args, **_kwargs): # pylint: disable=arguments-differ |
| 33 | if not shared.sd_loaded or not hasattr(shared.sd_model, 'unet'): |
| 34 | return |
| 35 | from modules.processing_helpers import create_random_tensors |
| 36 | args = list(args) |
| 37 | if p.subseed_strength != 0 and getattr(shared.sd_model, '_execution_device', None) is not None: |
| 38 | # alt method using slerp |
| 39 | # latents, var_latents, generator, var_generator = self.get_latents(p) |
| 40 | # self.set_slerp(p, latents, var_latents, generator, var_generator) |
| 41 | p.init_latent = create_random_tensors( |
| 42 | shape=[shared.sd_model.unet.config.in_channels, p.height // shared.sd_model.vae_scale_factor, p.width // shared.sd_model.vae_scale_factor], |
| 43 | seeds=p.seeds, |
| 44 | subseeds=p.subseeds, |
| 45 | subseed_strength=p.subseed_strength, |
| 46 | p=p |
| 47 | ) |
| 48 | log.debug(f'Latent: seed={p.seeds} subseed={p.subseeds} strength={p.subseed_strength} tensor={list(p.init_latent.shape)}') |
| 49 | p.init_latent = p.init_latent.to(device=shared.sd_model._execution_device, dtype=shared.sd_model.unet.dtype) # pylint: disable=protected-access |
nothing calls this directly
no test coverage detected