
MineSkin Diffusion is a unconditional image diffusion model capable of generating minecraft skins without any inputs.
MineSkin Diffusion v 1.1 trained on 2200000 steps at resolution 64x64 on minecraft girls and boys skins (about 60000 skins).
Examples
You can see 3D examples with using SkinView3d:
Model Usage
You can run model on GPU or CPU with using Google Colab Notebook or use HuggingFace Space (work only in CPU). If you want run model in your own, following this steps:
-
Installing library:
pip install diffusers #if use Colab this step can pass -
Model can work with standart diffusers pipeline:
from diffusers import DiffusionPipeline, DDPMPipeline, DDIMPipeline #choose one or search another pipeline from diffusers import DDIMScheduler, DDPMScheduler, DEISMultistepScheduler, LCMScheduler, PNDMScheduler, UniPCMultistepScheduler, DPMSolverMultistepScheduler #choose one device = ("mps" if torch.backends.mps.is_available() else "cuda" if torch.cuda.is_available() else "cpu")Or we can use own MineSkin Diffusion Pipeline:
from diffusers import DiffusionPipeline from diffusers import DDIMScheduler, DDPMScheduler, DEISMultistepScheduler, LCMScheduler, PNDMScheduler, UniPCMultistepScheduler, DPMSolverMultistepScheduler #choose one device = ("mps" if torch.backends.mps.is_available() else "cuda" if torch.cuda.is_available() else "cpu") class MSPipeline(DiffusionPipeline): def __init__(self, unet, scheduler): super().__init__() self.register_modules(unet=unet, scheduler=scheduler) @torch.no_grad() def __call__(self, batch_size = 1, num_inference_steps = 1000): x = torch.randn((batch_size, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size), device = device) * self.scheduler.init_noise_sigma self.scheduler.set_timesteps(num_inference_steps) for t in self.progress_bar(self.scheduler.timesteps): model_output = self.unet(x, t).sample x = self.scheduler.step(model_output, t, x).prev_sample x = (x / 2 + 0.5).clamp(0,1) x = x.detach().cpu().permute(0,2,3,1).numpy() x = self.numpy_to_pil(x) return x- Install model:
pipe = MSPipeline.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", use_safetensors=True).to(device) #Use different schedulers (choose one) pipe.scheduler = DDIMScheduler.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", subfolder="scheduler") pipe.scheduler = DDPMScheduler.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", subfolder="scheduler") pipe.scheduler = DEISMultistepScheduler.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", subfolder="scheduler") pipe.scheduler = LCMScheduler.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", subfolder="scheduler") pipe.scheduler = PNDMScheduler.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", subfolder="scheduler") pipe.scheduler = UniPCMultistepScheduler.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", subfolder="scheduler") pipe.scheduler = DPMSolverMultistepScheduler.from_pretrained("WiNE-iNEFF/Mineskin-Diffusion-v1.1", subfolder="scheduler")- Run model and get result:
import PIL images = pipe(batch_size=1, num_inference_steps=50) ''' batch_size - amount of generating images (need more CPU/GPU) num_inference_steps - amount of denoising steps (less steps increase speed of generating but quality get bad) ''' for n, img in enumerate(images): img.save(f"skin_{n}.png")
Model Details
- Developed by: Artsem Holub
- Model type: Diffusion-based unconditional image generation model
- License: MIT
Limitations
- The model does not achieve perfect quality
- The model cannot work with text
Training
Training Data The model developers used the minecraft skins stored on internet and packaged it into dataset for training the model.
Training Procedure MineSkin Diffusion v1.1 is a diffusion model that used Unet2DModel architecture from diffusers library.
- Hardware: T4 GPU
- Optimizer: AdamW
- Gradient Accumulations: 2
- Batch: 16
- Learning rate: warmup to 0.0001 for 50,000 steps and then kept constant
License
This model is licesed under a MIT license.
- You are free to host the model card and files (Without any actual inference or finetuning) on both commercial and non-commercial websites/apps/etc. Please state the full model name (MineSkin Diffusion v1.1) and include a link to the model card (https://huggingface.co/WiNE-iNEFF/Mineskin-Diffusion-v1.1)