Ir para o conteúdo
ModelListadosExterno
Baixar

Sprite Dx Anti Corruption v1

Pixel art restoration model that performs both quantization (denoising/sharpening) and optional background matting.

TipoOtherVersãoRevision b195cbfBnota

Fonte do modelo

Tipo
Other
Tamanho do arquivo
50,8 MB
Versão
vRevision b195cbf
Atualizado
20 de out. de 2026
Downloads
17
Fonte
Hugging Face

Descrição da fonte

SpriteDX Anti-Corruption Model v1.1.3

Pixel art restoration model that performs both quantization (denoising/sharpening) and optional background matting.

Model Description

  • Architecture: U-Net with residual connections
  • Input: 128x128 RGBA (4 channels)
  • Output: 128x128 RGBA (4 channels)
  • Training: Mixed dataset strategy with 50/50 split between:
    • Background matting task (composited images)
    • Quantization task (transparent images)

Capabilities

  1. Pixel Art Quantization: Removes blur, noise, and interpolation artifacts
  2. Background Matting: Extracts transparency from composited images
  3. Unified Processing: Handles both tasks in a single forward pass

Usage

import torch
from PIL import Image
import numpy as np

# Load model (you'll need the model architecture from train_v1.1.3.py)
from train_v1_1_1 import AntiCorruptionUNet

model = AntiCorruptionUNet()
checkpoint = torch.load("model.safetensors")
model.load_state_dict(checkpoint)
model.eval()

# Process image
image = Image.open("input.png").convert("RGBA")
image_tensor = torch.from_numpy(
    np.array(image, dtype=np.float32).transpose(2, 0, 1) / 255.0
).unsqueeze(0)

with torch.no_grad():
    output = model(image_tensor)
    output = model.post_process(output)

# Convert back to PIL
output_np = output[0].permute(1, 2, 0).numpy()
output_np = np.clip(output_np * 255, 0, 255).astype(np.uint8)
output_image = Image.fromarray(output_np, mode='RGBA')

Training Details

  • Corruption pipeline: nearest neighbor upscaling → noise → blur → translation → bicubic downscaling
  • Loss: Weighted RGB + Alpha loss with contrast and whiteness weighting
  • Data augmentation: Color shifts, flips, grayscale conversion

Limitations

  • Input must be 128x128 pixels
  • Best results on pixel art and sprites
  • May struggle with very complex transparency patterns

License

MIT

Fontes

1 fonte
Hugging FacePrimárioVersão b195cbf860da17e0fbdf29649b07e862fcfafa3a
huggingface.co/sprited/sprite-dx-anti-corruption-v1/tree/b195cbf860da17e0fbdf29649b07e862fcfafa3a

Verificado 20 de out.

Artefatos de modelo

1 artefato

model.safetensors

safetensors · 50,8 MB · SHA-256 f46cfe7025d6…aebb · Hugging Face

Download file

Trechos de fonte

3 trechos

--- license: mit tags: - image-to-image - pixel-art - sprite - background-removal - quantization --- # SpriteDX Anti-Corruption Model v1.1.3 Pixel art restoration model that performs both quantization (denoising/sharpening) and optional background matting. ## Model Description - **Architecture**: U-Net with residual connections - **Input**: 128x128 RGBA (4 channels) - **Output**: 128x128 RGBA (4 channels) - **Training**: Mixed dataset strategy with 50/50 split between: - Background matting task (composited images) - Quantization task (transparent images) ## Capabilities 1. **Pixel Art Quantization**: Removes blur, noise, and interpolation artifacts 2. **Background Matting**: Extracts transparency from composited images 3. **Unified Processing**: Handles both tasks in a single forward pass ## Usage ```python import torch from PIL import Image import numpy as np # Load model (you'll need the model architecture from train_v1.1.3.py) from train_v1_1_1 import AntiCorruptionUNet model = AntiCorruptionUNet() checkpoint = torch.load("model.safetensors") model.load_state_dict(checkpoint) model.eval() # Process image image = Image.open("input.png").convert("RGBA") image_tensor = torch.from_numpy( np.array(image, dtype=np.float32).transpose(2, 0, 1) / 255.0 ).unsqueeze(0) with torch.no_grad(): output = model(image_tensor) output = model.post_process(output) # Convert back to PIL output_np = output[0].permute(1, 2, 0).numpy() output_np = np.clip(output_np * 255, 0, 255).astype(np.uint8) output_image = Image.fromarray(output_np, mode='RGBA') ``` ## Training Details - Corruption pipeline: nearest neighbor upscaling → noise → blur → translation → bicubic downscaling - Loss: Weighted RGB + Alpha loss with contrast and whiteness weighting - Data augmentation: Color shifts, flips, grayscale conversion ## Limitations - Input must be 128x128 pixels - Best results on pixel art and sprites - May struggle with very complex transparency patterns ## License MIT

Source context: 17 downloads · 1 likes · Pipeline image-to-image · Repo sprited/sprite-dx-anti-corruption-v1

Source context: 8 downloads · 1 likes · Pipeline image-to-image · Repo sprited/sprite-dx-anti-corruption-v1