resolve/main/t2i-adapter/color_ref.png")  Then we can create our color palette by simply resizing it to 8 by 8 pixels and then scaling it back to original size.   Copied from PIL import Image

color_palette = image.resize((8, 8))
color_palette = color_palette.resize((512, 512), resample=Image.Resampling.NEAREST) Let’s take a look at the processed image.  Next, create the adapter pipeline   Copied import torch
from diffusers import StableDiffusi