To use a base64 image with rect.fills, convert it to an image hash using figma.createImage. After obtaining the image hash, assign it to the fills property of your rectangle. This ensures that the base64 image is properly processed and displayed as a fill.