Here’s how to use Stable Diffusion to make textures for Minecraft.

They’re all free (or have free alternatives), except for Minecraft itself.

Every program listed has all of the necessary functionality.

MinecraftRAMHeader

double-check you run Minecraft at least once after you download and install it.

The launcher downloads more files the first time the game is run.

Once you’ve done all that, we’re ready to start producing textures.

The Minecraft folder when it is installed in the default location.

Just right-press the Desktop, mouse over “new,” then click “Folder.”

We named ours “HTGExampleTextures” since it is easy to remember.

We’ll show you what that means.

Right-click the Minecraft JAR file and open it with 7-Zip, WinRAR, or any other archival program.

Navigate to where you installed Minecraft.

It is in “C:\Users(YourUserName)\AppData\Roaming.Minecraft” by default.

You’ll see something like this:

Open “assets\Minecraft\Textures\Block.”

The contents of the JAR file.

Note the file path at the top, marked “1.”

Minecraft will look for certain textures, like “diamond_ore.png,” at this location.

Head back over to the texture pack folder on the Desktop and open it.

The folder in the JAR file that contains the textures for blocks.

Create a new folder named “assets” in the texture pack folder.

Then create another folder named “minecraft” within the Assets folder.

Repeat that process for the “textures” and “block” folders.

Recreating the folder structure found in the JAR file in the Desktop folder we created.

Start Generating Textures With Stable Diffusion

Stable Diffusion is good for generating all sorts of imagery.

Ours is aimed at being fairly realistic looking.

We aren’t building a comprehensive texture pack that’ll replace every texture.

A tiled image of 10 potential stone textures generated with Stable Diffusion.

You should probably do the same — Stable Diffusion is good, but it isn’t perfect.

You’ll want multiple images so it’s possible for you to pick one you like.

We got decent results on our first run.

Select the texture you like, click "Save," then click "Send to Inpaint."

Minecraft uses textures that are 16x16 but can readily take textures that are 128x128.

The images we generated were 512x512, but not to worry.

We’ll deal with the size issue later.

Masked regions where diamonds will be generated.

Select it from the displayed textures and then click “Save.”

The save function records all of the variables needed to recreate this specific lot of images again.

Click “Send to Inpaint” last.

A tiled image showing six prospective diamond ore textures.

Inpainting allows you to selectively re-generate certain parts of an image based on a new prompt.

We’ll use it to generate the ore variants of our base stone texture.

Send to Inpaint can sometimes be a little buggy.

The four textures we generated: diamond ore, oak tree, dirt, and stone.

If you followedour guidethe output folder will be “C:\stable-diffusion-webui-master\outputs\txt2img-images”.

Inpaint has many of the same prefs as txt2img does.

Then just take your cursor, draw where you want the diamonds to appear on the stone surface.

Click "Image," then "Scale Image," to change the size of the texture.

The area you’ve selected will be masked out in all black.

After you’re done masking, click “Generate.”

We’re going to go with the middle-bottom result.

Make the texture smaller than 512x512. 128x128 is a good size. Then click "Scale."

Notice the square grid that is visible?

That occurs because we picked a texture that was dimmer along the outside edges and brighter towards the center.

you oughta make a run at avoid that, as it will look strange in-game.

Click "File," then click "Overwrite stone.png."

Click “Save” again to check that that you don’t lose any results you like.

Repeat this process for as many ores or blocks as you want to replace.

We’re replacing oak trees, stone, diamond ore, and dirt.

Create a text file named "pack.mcmeta" in your texture folder.

The default Stable Diffusion output folder is located at “C:\stable-diffusion-webui-master\outputs" on your box.

There are two folders that are important: txt2img and img2img.

Each texture you move needs to be renamed corresponding to the texture you want to replace.

Click yes.

For example, the stone texture gets renamed “stone.png”.

you’re free to always check 1.19.2.jar to figure out what each texture is named.

We also need to scale these images down a bit since they’re currently a bit large.

Open the MCMETA file with Visual Studio Code.

Right-click your texture, mouse over “Open With,” and select GIMP.

Enter the dimensions you want and click “Scale.”

Keep your image square.

Select both the assets folder and the MCMETA file, right-click, then click "Add to HTGExampleTextures.zip"

16x16, 32x32, 64x64, 128x128, and so on.

You’ll immediately notice that your image is way smaller than it was before.

select “File” in the top-left corner, then click “Overwrite stone.png.”

Click HTGExampleTextures.zip in the "Select Resource Packs" page to swap out the vanilla textures for our textures.

Repeat the process for all of the textures you want to replace.

The hard part is over.

Right-click empty space, mouse over “New,” then click “Text Document.”

Our textures displayed in Minecraft. From left to right: Stone, Dirt, Diamond Ore, Oak.

You’ll immediately be able to key in in a name.

You’ll get a warning about doing that.

Normally the warning is correct; renaming file extensions at random is bad practice.

In this case, however, it doesn’t matter at all.

Just click “Yes.”

Notepad will work in a pinch, but there are better programs.

It lets Minecraft know which version of the game your resource pack is designed for.

You’re done editing the file, so close out your text editor.

Don’t accidentally add it to a “.7z” file.

Hold Ctrl while clicking to select multiple items.

You’re good to go.

Launch Minecraft, then go to Options > Resource Packs and grab the pack you just made.

When you load into any world, your textures will replace the corresponding vanilla textures.

For example, our stone base texture is a bit dark.

Entities are harder to retexture due to their more complex geometries.

The added difficulty is UV unwrapping the textures, so they are applied correctly to the models.

And this is only the beginning.

Related:How to Use Stable Diffusion to Make AI GIFs and Videos