[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92322":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},92322,"SesquiLSR","LoganBooker\u002FSesquiLSR","LoganBooker","Arbitrary scale latent upscaler for SDXL, Flux, Flux2, and Wan 2.1\u002FAnima\u002FQwen Image. Supports fractional scaling up to 2.0x. Includes ComfyUI node and pretrained weights.","",null,"Python",60,3,1,0,7,42.51,"MIT License",false,"main",true,[23,24,25,26,27,28,29],"comfyui","latent-diffusion","latent-space","stable-diffusion","super-resolution","upscaler","upscaling","2026-07-22 04:02:05","# SesquiLSR\n\nLatent upscaler supporting arbitrary scales between 1.0-2.0x for various models\u002FVAEs. The name comes from *sesqui*- (Latin for \"one and a half\"); the original model was a fixed 1.5x upscale using rational resampling. The current architecture uses the same principle: PixelShuffle to 2x then learned downsampling to the target size. I kept the name as it remained relevant (at least in spirit).\n\n## Features\n\n- **Multi-model support** - SDXL, Flux, Z-Image Turbo, Flux2 Klein, Krea 2, Wan 2.1, Qwen Image and Anima from a single architecture\n- **Arbitrary scale** in [1.0x, 2.0x] - not limited to fixed 2x\n- **~3M parameters, ~12MB weights** across all variants\n- **Sub-6ms inference** in latent space, with no VAE round-trip\n- **ComfyUI node included** - drop-in, no model or VAE connection required\n\n## Use case\n\nSesqui is not meant to replace full-blown GAN-based upscaling pipelines. Instead, it should be used in place of \"raw\" latent upscaling via bilinear or bicubic in preparation for additional denoising. \n\nNaive interpolation damages the latent, so the output image requires high denoising strength (>= 0.5) to recover. A learned upscaler like Sesqui produces cleaner latents that need less refinement in the second pass.\n\n## Supported models with pretrained weights\n\nAll weights can be found in the `models\u002F` folder of this repository.\n\n| VAE | Models | Weight file |\n|---|---|---|\n| SDXL | SDXL | `upscaler_SDXL.safetensors` |\n| Flux | Flux, Z-Image Turbo, Lumina | `upscaler_Flux.safetensors` |\n| Flux2 | Flux2, Flux2 Klein, Ideogram 4 | `upscaler_Flux2.safetensors` |\n| Wan | Wan 2.x, Krea 2, Anima, Qwen Image | `upscaler_Wan21.safetensors` |\n\nEach model is trained on VAE latents directly. The format adaptors handle any pipeline-level transforms (such as patchification\u002Fbatch norm) so the upscaler always operates in clean VAE latent space. We do this so the upscalers don't need retraining when a new model is released that uses an existing VAE, it just needs a new adaptor (and sometimes not even that).\n\n## Quick start\n\n```python\nimport torch\nfrom safetensors.torch import load_file\nfrom sesqui_lsr import LatentUpscaler\n\nmodel = LatentUpscaler(in_channels=4)\nstate_dict = load_file(\"models\u002Fupscaler_SDXL.safetensors\")\nmodel.load_state_dict(state_dict)\nmodel.eval().requires_grad_(False)\n\nlatent = torch.randn(1, 4, 128, 128)          # SDXL 1024px (8x downsampled latent)\ntarget_size = (192, 192)                      # upscale to 1536px\nwith torch.no_grad():\n    upscaled = model(latent, target_size)     # -> (1, 4, 192, 192)\n```\n\n### ComfyUI installation\n```\ncd ComfyUI\u002Fcustom_nodes\ngit clone https:\u002F\u002Fgithub.com\u002FLoganBooker\u002FSesquiLSR.git\n```\n\nThe node is accessible under `latent\u002Fupscaling\u002FUpscale Latent (SesquiLSR)`. The node handles latent upscaling and format conversion internally.\n\n## Format adaptors\n\nSome pipelines transform the VAE output before passing it to the diffusion model. An adaptor converts between the pipeline's latent format and the raw VAE latent space that Sesqui operates on. They require no arguments - just pick the one matching your model:\n\n```python\nfrom sesqui_lsr import make_identity, make_flux2, make_wan21\n\nadaptor = make_identity(4)  # SDXL, Flux, Lumina, Z-Image\nadaptor = make_flux2()      # Flux2\nadaptor = make_wan21()      # Wan 2.1, Qwen Image, Anima\n\n# Use it\nupscaled = adaptor.from_vae_latent(\n    model(\n        adaptor.to_vae_latent(latent),\n        adaptor.vae_target_size(target_size),\n    )\n)\n```\n\n## Benchmarks\n\nEach test image is Lanczos-downsampled to the low-resolution size, encoded to a latent via the VAE, upscaled by the method, decoded back to pixels, and compared against the **original high-resolution image**. This measures the full pipeline quality including VAE reconstruction loss. Metrics are computed using [pyiqa](https:\u002F\u002Fgithub.com\u002Fchaofengc\u002FIQA-PyTorch).\n\n- Test images: 4 images at 1024x1024, centre-cropped to 768x768 (sourced from the [pseudo-camera-10k](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fbghira\u002Fpseudo-camera-10k) dataset).\n- Scales: 1.5x, 2.0x\n- Precision: fp32, batch size 1\n- GPU: NVIDIA GeForce RTX 5090 Laptop (24GB)\n\n### At a glance: 1.5x latent upscaling\n\n| Model | Sesqui LPIPS ↓ | Bicubic LPIPS ↓ | Improvement |\n|---|---:|---:|---:|\n| SDXL | 0.1249 | 0.4484 | 72% lower |\n| Flux | 0.0974 | 0.2915 | 67% lower |\n| Flux2 | 0.0587 | 0.1732 | 66% lower |\n| Wan 2.1 | 0.0919 | 0.1909 | 52% lower |\n\n### SDXL comparison with other latent upscalers\n\nSDXL is useful for direct comparison because latent upscaler alternatives exist for it. `★` marks the best value among learned latent methods.\n\n| Method | Params | 1.5x LPIPS ↓ | 1.5x PSNR ↑ | 2.0x LPIPS ↓ | 2.0x PSNR ↑ |\n|---|---:|---:|---:|---:|---:|\n| **Sesqui** | 3.07M | ★ 0.1485 | 26.06 | ★ 0.1988 | 25.09 |\n| NNLatent | 6.27M | 0.2350 | ★ 26.56 | 0.3158 | ★ 25.60 |\n| city96 v2.1 | 0.60M | 0.3265 | 23.72 | 0.3809 | 22.79 |\n| LSRNA | 1.29M | 0.3439 | 23.00 | 0.3696 | 22.71 |\n\nPSNR measures exact pixel reconstruction, while LPIPS better reflects perceptual similarity. Sesqui trades a small amount of PSNR for much, much lower LPIPS, which corresponds to cleaner perceptual detail in the visual comparisons.\n\n## Visual comparison\n\n### SDXL, 2.0x\nUseful for direct comparison because other upscalers exist for it. These strips compare the same crop across Sesqui, NNLatent, city96, LSRNA, and Bicubic.\n\n![SDXL method comparison cat 2.0x](benchmark\u002Fimages\u002Fsdxl_competitors_cat_2.0x.png)\n\n![SDXL method comparison bug 2.0x](benchmark\u002Fimages\u002Fsdxl_competitors_bug_2.0x.png)\n\n- Sesqui achieves 37% lower LPIPS than NNLatent at 1.5x (0.1485 vs 0.2350) while remaining in the same PSNR range.\n- Sesqui is about 2.2x faster than NNLatent and about 3.5x faster than LSRNA.\n\n### Flux2, 2.0x\nSesqui is capable of substantially cleaner output than the SDXL comparison table alone suggests. This Flux2 comparison shows four image types against the original HR target and a bicubic latent baseline.\n\n![Flux2 quality comparison 2.0x](benchmark\u002Fimages\u002Fflux2_quality_2.0x.png)\n\nAt 2.0×, Sesqui scores LPIPS 0.1031 versus 0.2817 for bicubic latent upscaling (63% lower). Again, Sesqui favours perceptual detail (texture) over strict pixel accuracy (structure), hence the weaker reconstruction of the fine grid in the building image, but excellent results in the other three crops.\n\n## Training\n\nThis section provides a general overview of the training methodology; training code will be released once I've cleaned it up.\n\n### Multi-stage training\n\nEach model is trained in 1-3 progressive stages, where later stages finetune from the previous stage's weights with different loss configurations and lower learning rates. This approach was inspired by the findings in \"[One Small Step in Latent, One Giant Leap for Pixels: Fast Latent Upscale Adapter for Your Diffusion Models](https:\u002F\u002Farxiv.org\u002Fabs\u002F2511.10629)\".\n\nAll stages use batch size 1, random 512x512 HR crops with log-uniform scale sampling in [1.0, 2.0]. The first stage uses latent and FFT loss, the second latent and multi-band pixel loss, with the third depending on the type of model but usually some combination of pixel loss, 1-2 perceptual losses and DC shift loss (for SDXL to combat hue shift). Luminance-based sharpening is also used on HR targets during the last stage to promote sharper outputs from the upscaler.\n\nA modified version of Meta's Schedule-Free AdamW is used as an optimizer.\n\nTotal training time and steps varies from model to model; the shortest being 50 minutes (one stage, 25k steps), and the longest 6 hours, 30 minutes (three stages, ~155k steps). All models were trained on a single 5090 laptop GPU.\n\n## ComfyUI node parameters\n\n- **model_format**: The VAE latent configuration. **Must match the incoming latent.**\n  - `SDXL`: SDXL only; not compatible with SD 1.5.\n  - `Flux`: Flux, Z-Image Turbo, Lumina.\n  - `Flux2`: Flux2, Flux2 Klein; BN-packed latent.\n  - `Ideogram 4`: Flux2 VAE; shift\u002Fscale-packed latent.\n  - `Wan 2.1`: Wan 2.x, Krea 2, Anima, Qwen Image.\n- **scale**: Target scale factor between [1.0, 2.0]. Default `1.5`, step `0.05`.\n- **half_precision**: Default `on`. Loads the upscaler model in bf16 (fp16 if unsupported). Half-precision has no effect on quality and should be left on, however the setting is available for debugging purposes.\n","SesquiLSR 是一个面向扩散模型的任意比例潜在空间上采样器，支持 SDXL、Flux、Flux2、Wan 2.1、Anima 和 Qwen Image 等主流模型的 VAE 潜在表示，可在 1.0–2.0x 范围内精确指定缩放因子。其核心采用 PixelShuffle 上采样后接可学习下采样的轻量架构（约300万参数），避免 VAE 编解码往返，在潜空间内实现亚毫秒级推理；提供开箱即用的 ComfyUI 节点，自动处理不同模型的潜格式适配。适用于需高质量潜空间上采样的多阶段生成流程，尤其适合替代双线性\u002F双三次插值以降低后续重采样强度。",2,"2026-07-08 04:30:04","CREATED_QUERY"]