Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Faïence

Text-to-texture diffusion model for Minecraft. Generates 16×16 RGBA textures from a text prompt — sharp, pixel-exact, ready to drop into a resource pack.

Faïence is the French art of hand-painting glazed ceramic tiles, one at a time.

Installation

Requires Python 3.10+ and PyTorch (CUDA, CPU or MPS).

pip install torch
pip install -r requirements.txt

Download the latest weights from the GitHub release https://github.com/LeChatOTapas/faience-ai/releases/latest/download/faience.pth and place the file next to generate.py.

Usage

python generate.py --prompt "diamond sword" --upscale 16
python generate.py --prompt "ruby ore" --tile
python generate.py --prompt "emerald hammer" --sprite
python generate.py --prompt "sapphire block" --tile --num 6

Output PNGs are written to generated/. Without --upscale you get the native 16×16 file; --upscale 16 additionally scales it to 256×256 (nearest-neighbor) for inspection.

Prompt structure

Prompts are in English (the model is conditioned on CLIP text embeddings). Two structure keywords were part of the training captions and act as reliable controls:

Flag Appended text Effect
--tile , full tile Full-coverage block texture (blocks, ores, terrain)
--sprite , sprite Item on a transparent background

--tile is strongly recommended for blocks and ores. The attributes can also be written manually, together with color words, which the model follows: "glowstone, yellow, full tile", "black and red sword, sprite".

Options

Option Default Description
--num N 1 Variants per prompt
--seed N random Reproducible sampling
--steps N 50 Denoising steps
--guidance G 2.0 Text guidance strength (1.0 = unguided, 3.0 = literal)
--cfg_tmax T 500 Apply guidance only below this noise level (see below)
--colors N off Quantize palette to N colors
--upscale K 1 Nearest-neighbor upscaling factor
--prompt_file F Batch generation, one prompt per line

Model

Faïence is a conditional pixel-space DDPM (~72M parameters). There is no VAE and no upscaler: denoising operates directly on the 16×16×4 RGBA grid, so every generated pixel is an actual pixel rather than a decoded approximation.

  • U-Net (diffusers UNet2DConditionModel, 16→8→4) with cross-attention to a frozen CLIP ViT-B/32 text encoder — CLIP embeddings are what make unseen compositions work ("uranium ore", "obsidian crown").
  • v-prediction with zero-terminal-SNR (cosine schedule), required for generation from pure noise at this resolution.
  • Ancestral DDIM sampling (eta 1.0): reinjected noise preserves the grain of stochastic textures (ores, wool) instead of averaging it away.
  • Interval guidance (--cfg_tmax): classifier-free guidance is applied only below a noise-level threshold, where the unconditional estimate is reliable. This permits strong guidance without the artifacts CFG normally produces under zero-terminal-SNR.
  • Training data: ~14,500 textures at 16×16 (vanilla, mods, resource packs), with automatically enriched captions (dominant colors, tile/sprite structure) applied with dropout so both plain and attributed prompts stay in-distribution.

Known limitations

  • 16×16 output only, by design.
  • English prompts only.
  • Block prompts generally need --tile for full-tile coverage.
  • A few concepts remain unreliable (bows, notably). Use --num 4 and pick.

License

The code is released under the MIT License (see LICENSE). The model weights were trained on Minecraft textures (© Mojang/Microsoft) and community mod and resource-pack textures; they are provided for personal and community use (resource-pack creation). This project is not affiliated with Mojang.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages