Nodes/ComfyUI-Replicate/Replicate tstramer/material-diffusion
ComfyUI Node

Replicate tstramer/material-diffusion

Tileable textures via API

By replicate·Created 2 years ago·Updated 2 years ago· 207
Replicate tstramer/material-diffusion
  • init_image
  • mask
  • IMAGE
prompt
width512
height512
prompt_strength0.80
num_outputs1
num_inference_steps50
guidance_scale7.50
schedulerK-LMS
seed
force_rerunfalse

Material Diffusion is a Stable-Diffusion-based model tuned for one specific job: generating seamless, tileable textures and materials - the kind you'd wrap onto a 3D model, tile across a floor, or drop into a game engine without a visible seam. It's an SD1.x-era fork (from tstramer) built around that use case, and this node runs it through Replicate: REPLICATE_API_TOKEN, pay-per-run, nothing downloaded.

It's a niche, older tool. For a modern texture pipeline you'd probably reach for newer models plus a tiling ControlNet or a dedicated seamless mode. But if you want a quick "give me a repeating stone/wood/fabric texture" without building any of that, Material Diffusion does exactly that in one node.

How it works

Under the hood it's classic latent diffusion (single CLIP encoder, the 2022–23 generation), specialized toward tileable output. Because it's built on the SD1.x foundation, it also inherits that era's img2img and inpainting support - you can seed it with an existing texture and vary it, or mask part of one and regenerate. The node relays everything to the hosted endpoint on Replicate; a GPU there does the work.

The inputs and outputs that matter

  • prompt - describe the material: "seamless mossy stone wall," "tileable oak wood grain," that sort of thing. Keep it under the 77-token limit.
  • init_image (IMAGE) + prompt_strength (0.8) - supply a starting texture for img2img; prompt_strength controls how far it drifts from your source.
  • mask (IMAGE) - for inpainting: mask a region and regenerate just that part.
  • width / height (both 512, from a fixed size list) - keep these near native; SD1.x-era models break down when pushed much larger.
  • num_inference_steps (50), guidance_scale (7.5), and scheduler (K-LMS default, plus DDIM and PNDM) - standard classic-SD controls; the defaults are sane.

num_outputs (up to 10) and seed round it out; force_rerun forces a fresh run. Output is one IMAGE.

How to install it

One install covers every Replicate node.

  • ComfyUI Manager: search ComfyUI-Replicate, install, restart.
  • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/replicate/comfyui-replicate
    cd comfyui-replicate
    pip install -r requirements.txt
    
    then restart.

Nothing lands on your GPU - the model runs on Replicate's servers, so the only install is the replicate Python client. Set your token before launching ComfyUI: export REPLICATE_API_TOKEN="r8_..." (replicate.com/account/api-tokens). No token, no runs.

Common issues & troubleshooting

Auth error first run. REPLICATE_API_TOKEN must be set before ComfyUI launches. Set it, restart.

The texture has a visible seam. Tileability is what this model targets, but it's not magic - simpler, more uniform materials tile cleaner than busy ones with strong large features. Describe an even, repeating surface and avoid asking for a big focal object.

Detail looks dated. It's an SD1.x-era model. For high-fidelity PBR-style materials you've outgrown it; for quick stylized textures it's fine.

Same result on re-run. Replicate cached identical inputs. Change the seed or set force_rerun.

It bills per run. Each generation is a paid Replicate prediction, and num_outputs: 10 is ten of them at once. Handy for texture variety, easy to spend on.

CategoryReplicate

Inputs (12)

NameTypeDefaultDescription
promptoptSTRING
widthoptCOMBO51213 options: 128, 256, 384, 448, 512, 576, +7
heightoptCOMBO51213 options: 128, 256, 384, 448, 512, 576, +7
init_imageoptIMAGE
maskoptIMAGE
prompt_strengthoptFLOAT0.80
num_outputsoptINT11–10
num_inference_stepsoptINT501–500
guidance_scaleoptFLOAT7.501–20
scheduleroptCOMBOK-LMS3 options: DDIM, K-LMS, PNDM
seedoptINT
force_rerunoptBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE