/ Модель

Характеристики

Лицензия
Apache 2.0
Библиотека
pytorch
Опубликована
18 сен 2026

inkvec-sr-001

Преобразование изображенийИзображение, текст → изображение

Дообученная модель MambaIRv2-Small увеличивает логотипы и иконки в 4 раза и улучшает контуры перед векторизацией.

0скачиваний за 30 дней0лайковвеса обновлены18 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Inkvec Super-Resolution (inkvec-sr-001) — модель сверхвысокого разрешения от LogoLabs, предназначенная для увеличения растровых логотипов, значков и плоской графики перед векторизацией. Это дообученная модель MambaIRv2-Small на 9,77 млн параметров, основанная на MambaIR и использующая архитектуру Mamba с механизмом маршрутизации по 128 prompt-токенам. Модель увеличивает изображение в 4 раза, повышая чёткость границ и сглаживая артефакты сжатия.

Модель рассчитана на восстановление логотипов и иконок после JPEG/WebP-сжатия, изменения размера, создания скриншотов или пересылки через мессенджеры. Улучшенные контуры помогают последующему трассировщику строить более точные SVG с меньшим числом параметров. По данным README, модель проверялась на 120 отложенных изображениях; для фотографий она не предназначена.

Веса опубликованы в формате PyTorch fp16 вместе с кодом архитектуры. Для инференса рекомендуется CUDA; доступна более медленная реализация на чистом PyTorch для CPU и других GPU. Обработка цветовых каналов RGB выполняется отдельно от альфа-канала, который масштабируется интерполяцией Lanczos. Веса и код архитектуры распространяются по лицензии Apache-2.0, допускающей коммерческое, независимое и академическое использование.

Сценарии применения

  • увеличение растровых логотипов в 4 раза перед трассировкой в SVG
  • восстановление контуров сжатых JPEG-логотипов
  • улучшение иконок после сжатия WebP
  • подготовка плоской графики к растрово-векторному преобразованию

Ограничения

Модель обучена на логотипах и графике иконок, поэтому фотографии находятся вне её обучающего распределения. Для полной скорости рекомендуется CUDA; реализация на чистом PyTorch работает медленнее, а случайная маршрутизация Gumbel-Softmax может приводить к разным результатам между запусками без фиксации RNG.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Inkvec Super-Resolution (inkvec-sr-001)

A fine-tuned MambaIRv2-Small (9.77M parameters) 4× super-resolution model for logos, icons and flat artwork, packaged as a pre-processing stage before vectorisation. Sharper, harder edges give a boundary tracer cleaner contours to follow.

This is the standalone release of the super-resolution pre-pass shipped inside Inkvec, LogoLabs' raster-to-vector tracer. The companion in-engine denoiser (a ConvNeXt U-Net for JPEG/WebP damage) is at Logolabs/inkvec-denoiser-001.

Licence: Both the fine-tuned weights (logo_sr_x4.pt) and the bundled MambaIRv2 architecture code are released under the Apache-2.0 Licence. Commercial, independent, and academic use are fully supported.

What it's for

Feed it a raster logo or icon that has been through JPEG/WebP compression, a screenshot pipeline, a resize, or a chat app, and it hands back a 4× upscaled image with sharper edges, flatter interiors, and reduced compression artefacts — purpose-built to make the downstream vectorisation step produce tighter, lower-parameter SVGs.

On JPEG q50 input the SR + trace pipeline takes ΔE₀₀ from 1.001 to 0.438 and the parameter count from 19.81× the artist's to 6.78×. On a real wordmark: 35.57 dB vs bicubic's 31.23 dB (+4.34 dB).

Architecture

MambaIRv2-Small (Guo et al., CVPR 2025) — an Attentive State-Space Model (ASSM) with 128 prompt tokens using Gumbel-Softmax routing, built on the original MambaIR (Guo et al., ECCV 2024). The architecture file (mambairv2_arch.py) is made standalone with vendored to_2tuple / trunc_normal_ shims — no basicsr dependency required.

Key specs:

  • Parameters: 9.77M
  • Scale factor: 4×
  • Checkpoint: perceptual-finetune/last, step 19,000
  • Weights format: fp16, ~20 MB
  • Trained on: Logo + SVG-stack icon art

What's in this repo

filepurpose
logo_sr_x4.ptmodel weights (fp16, ~20 MB) + architecture kwargs
mambairv2_arch.pyMambaIRv2 architecture, standalone (no basicsr needed)
requirements.txtPython dependencies

Checkpoint contents

torch.load("logo_sr_x4.pt") returns a dict with keys:

  • arch_kwargs — constructor arguments for MambaIRv2(**arch_kwargs)
  • state_dict — model weights (fp16)
  • scale — upscale factor (4)
  • trained_step — training step (19,000)
  • source_run — name of the training run

Evaluation

Scored on 120 held-out validation images at 4×, ranked by foreground PSNR (alpha > 0). Logos are mostly empty background, and whole-image PSNR rewards reproducing blank space — the top two models swap order between the two columns:

 42.67 dB fg   43.85 dB overall   perceptual-finetune/last (19000)   ← this checkpoint
 41.99 dB fg   43.33 dB overall   geometry-finetune/last   (8500)
 41.89 dB fg   43.48 dB overall   geometry-finetune/best   (8750)
 41.89 dB fg   43.63 dB overall   chained-x16/best         (19200)
 40.50 dB fg   42.66 dB overall   official-x4-prodigy/best (3750)
 39.98 dB fg   42.08 dB overall   alpha2048/last           (9000)

Usage

With Inkvec (recommended)

# Auto mode: traces first, cleans only if degradation is detected
inkvec input.png -o output.svg --sr auto

# Always clean
inkvec input.png -o output.svg --sr on

Standalone Python

import torch
from pathlib import Path

# Download from HuggingFace
from huggingface_hub import hf_hub_download
weights = hf_hub_download("Logolabs/inkvec-sr-001", "logo_sr_x4.pt")
arch_py = hf_hub_download("Logolabs/inkvec-sr-001", "mambairv2_arch.py")

# Load
import sys, importlib.util
spec = importlib.util.spec_from_file_location("mambairv2_arch", arch_py)
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)

blob = torch.load(weights, map_location="cpu", weights_only=False)
net = mod.MambaIRv2(**blob["arch_kwargs"])
net.load_state_dict({k: v.float() for k, v in blob["state_dict"].items()}, strict=False)
net = net.cuda().eval()

# Upscale
from PIL import Image
import numpy as np
img = np.asarray(Image.open("input.png").convert("RGB"), np.float32) / 255.0
patch = torch.from_numpy(img).permute(2, 0, 1)[None].cuda()
with torch.no_grad():
    out = net(patch).clamp(0, 1)

Determinism

MambaIRv2's ASSM uses F.gumbel_softmax(logits, hard=True) which samples stochastic Gumbel noise on every forward pass — even under model.eval() and torch.no_grad(). Left unpinned, consecutive runs of the same image produce pixel discrepancies of up to 12.45 levels.

Inkvec fixes this by pinning the RNG with seed 0x5641_4331 ("VAC1") before every forward pass, guaranteeing bit-exact SVG reproducibility. Replacing gumbel_softmax with argmax (zero-temperature limit) degrades quality: ΔE₀₀ worsens from 0.5364 to 0.5492.

Requirements

torch>=2.4
numpy
Pillow
einops
timm
mamba-ssm  # CUDA selective-scan kernels

Note: Inkvec's tools/inkvec_sr/scan.py provides a pure-PyTorch Hillis-Steele associative scan that works without the mamba-ssm CUDA kernels, enabling CPU and non-NVIDIA GPU inference (slower but functional).

Known limitations

  • CUDA recommended — mamba-ssm kernels are CUDA-only (the pure-PyTorch fallback works but is slower).
  • RGB-only trunk — alpha is carried through separately via Lanczos interpolation. RGB is zeroed where alpha ≈ 0 to prevent dark halos that would become spurious traced contours.
  • Domain-specific — trained on logos + SVG-stack icon art. Photographs are out of distribution.

Citation

If you use this model, please cite both Inkvec and the original MambaIRv2 paper:

@software{inkvec_sr2026,
  title   = {Inkvec Super-Resolution: a MambaIRv2 x4 upscaler for vectorisation pre-processing},
  author  = {LogoLabs and Deleanu, Stefan-Lucian},
  year    = {2026},
  url     = {https://huggingface.co/Logolabs/inkvec-sr-001}
}

@inproceedings{guo2025mambairv2,
  title     = {MambaIRv2: Attentive State Space Restoration},
  author    = {Guo, Hang and Guo, Yong and Zha, Yaohua and Zhang, Yulun and Li, Wenbo and Dai, Tao and Xia, Shu-Tao and Li, Yawei},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      = {2025}
}

Acknowledgements

We acknowledge EuroHPC JU for awarding the project ID EHPC-AIF-2026PG01-907 access to resources on Arrhenius GPU at NAISS, Sweden. The Arrhenius system is operated by the National Academic Infrastructure for Supercomputing in Sweden (NAISS). Compute time on Arrhenius was instrumental in the wider Inkvec research effort behind this release — including the training of the companion inkvec-denoiser-001 restoration model — though the super-resolution fine-tune packaged here was trained and evaluated on local hardware.

The architecture fine-tuned here is MambaIRv2 (Guo et al., CVPR 2025), which builds on the original MambaIR (Guo et al., ECCV 2024). We thank the authors for releasing the official implementation under Apache-2.0 at github.com/csguoh/MambaIR, from which the standalone architecture file in this repository is derived.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · pytorch

Нельзя запустить

Модели «картинка → картинка» пока не запускаются.

Ревизия весов
a16b174

0 моделей