pub struct LatentUpsampler { /* private fields */ }Expand description
Latent upsampler for 32×32 → 64×64 latent upsampling.
This enables 512×512 output resolution (vs 256×256) by upsampling the latent representation before VAE decoding. The upsampler uses a separate U-Net model with 10-step DDIM denoising in latent space.
§Modes
- SdX2: Uses the sd-x2-latent-upscaler U-Net with DDIM denoising.
- BilinearVae: Fallback mode that uses simple bilinear upsampling.
§Example
ⓘ
use oxigaf_diffusion::{LatentUpsampler, UpsamplerMode};
use candle_core::Device;
let device = Device::Cpu;
let upsampler = LatentUpsampler::load(
UpsamplerMode::SdX2,
"weights/upsampler",
&device,
)?;
// Upsample latents from 32×32 to 64×64
let upsampled = upsampler.upsample(&latents, 10)?;Implementations§
Source§impl LatentUpsampler
impl LatentUpsampler
Sourcepub fn load(
mode: UpsamplerMode,
weights_path: &Path,
device: &Device,
) -> Result<Self, DiffusionError>
pub fn load( mode: UpsamplerMode, weights_path: &Path, device: &Device, ) -> Result<Self, DiffusionError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LatentUpsampler
impl !RefUnwindSafe for LatentUpsampler
impl Send for LatentUpsampler
impl Sync for LatentUpsampler
impl Unpin for LatentUpsampler
impl UnsafeUnpin for LatentUpsampler
impl !UnwindSafe for LatentUpsampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more