Non realistic textures prompt

I don’t quite understand how to generate non realistic textures. For example, I want to get a cartoonish texture for a woolen winter hat material, but all the images seem quite hyperdetailed (last 6 images were generated with shape image, still quite detailed)

Hi @Jarmallnick! The style training system (currently available for the sprite tool) is currently being integrated with Muse Texture. When it is ready you can provide a few samples in your preferred style and all of your future outputs will follow that style.

The model is trained almost entirely on photorealistic textures, however you should be able to achieve the effect you are looking for by converting your shape image into a canny edge map (we are working on adding a feature to do this automatically) and prompting for something that does not typically contain a lot of detail in real life (just “orange” or “orange pattern” might work).

If you have python available, here is a small script that uses tkinter to create a GUI for converting images to a canny map. Note your input needs to be seamless or the generated texture will not have perfect seams.

import cv2
from tkinter import *
from PIL import Image, ImageTk
from tkinter import filedialog
import sys


class CannyEdgeGUI:
    def __init__(self, img_path):
        self.root = Tk()
        self.root.title('Canny Edge Detection')
        self.img_path = img_path
        self.img = cv2.imread(self.img_path, cv2.IMREAD_GRAYSCALE)
        self.img = cv2.resize(self.img, (512, 512))

        # GUI
        self.c1 = Scale(self.root, from_=0, to=500, orient=HORIZONTAL, label='low_threshold', command=self.update_image)
        self.c1.set(50)
        self.c1.pack()
        self.c2 = Scale(self.root, from_=0, to=1000, orient=HORIZONTAL, label='high_threshold', command=self.update_image)
        self.c2.set(100)
        self.c2.pack()
        self.c3 = Scale(self.root, from_=1, to=20, orient=HORIZONTAL, label='blur', command=self.update_image)
        self.c3.set(1)
        self.c3.pack()
        self.canvas = Canvas(self.root, width=512, height=512)
        self.canvas.pack()
        self.save_button = Button(self.root, text='Save Image', command=self.save_image)
        self.save_button.pack()
        self.update_image()

        self.root.mainloop()

    def update_image(self, _=None):
        low = self.c1.get()
        high = self.c2.get()
        blur = self.c3.get()

        # Make sure the blur size is odd
        blur = blur if blur % 2 == 1 else blur + 1

        img = cv2.GaussianBlur(self.img, (blur, blur), 0)
        edges = cv2.Canny(img, low, high)
        self.edges = edges

        # Convert image for tkinter
        img = cv2.cvtColor(edges, cv2.COLOR_GRAY2BGR)
        img = Image.fromarray(img)
        imgtk = ImageTk.PhotoImage(image=img)
        self.canvas.create_image(0, 0, anchor=NW, image=imgtk)
        self.canvas.image = imgtk

    def save_image(self):
        save_path = 'canny_' + self.img_path
        cv2.imwrite(save_path, self.edges)


if __name__ == "__main__":
    if len(sys.argv) != 2:
        print(f"Usage: {sys.argv[0]} image_path")
        exit(1)

    CannyEdgeGUI(sys.argv[1])