You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Waifu-Colorize-XL

image/png

Waifu-Colorize-XL is an SDXL-based model specifically designed for colorizing anime-themed images.

Overview

Waifu-Colorize-XL is further trained from Waifu-Inpaint-XL, enabling it to colorize grayscale or binarized images.

Model Details

🧨 Diffusers

image1 image2
import torch
from diffusers import StableDiffusionXLInpaintPipeline
from diffusers.utils import load_image

pipeline = StableDiffusionXLInpaintPipeline.from_pretrained(
  'ShinoharaHare/Waifu-Colorize-XL',
  torch_dtype=torch.half
)
pipeline.to('cuda')

grayscale_image = load_image('/static-proxy?url=https%3A%2F%2Fcdn-uploads.huggingface.co%2Fproduction%2Fuploads%2F630ed69a31970d1cd4fd575d%2FZusF3zcH-auhPgSxY0LKs.png')
prompt = '' # Write your own prompt if you want.

masked_image_latents = pipeline.vae.encode(
  pipeline.image_processor.preprocess(grayscale_image).to(pipeline.device, pipeline.dtype)
)[0].sample() * pipeline.vae.config.scaling_factor

colorized_image = pipeline(
  prompt=prompt,
  image=grayscale_image,
  mask_image=torch.ones((1, grayscale_image.height, grayscale_image.width)),
  masked_image_latents=masked_image_latents,
  num_inference_steps=28,
  strength=1.0,
  guidance_scale=5.0 if prompt else 0.0,
  height=grayscale_image.height,
  width=grayscale_image.width
).images[0]

colorized_image.show()

ComfyUI

This model requires a custom node to function correctly.

Please install InpaintModelConditioningAdvanced first.

image

Downloads last month
541
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ShinoharaHare/Waifu-Colorize-XL

Dataset used to train ShinoharaHare/Waifu-Colorize-XL

Collection including ShinoharaHare/Waifu-Colorize-XL