Install this extension via the ComfyUI Manager by searching
for ComfyUI-ZeroShot-MTrans
1. Click the Manager button in the main menu
2. Select Custom Nodes Manager button
3. Enter ComfyUI-ZeroShot-MTrans in the search bar
After installation, click the Restart button to
restart ComfyUI. Then, manually
refresh your browser to clear the cache and access
the updated list of nodes.
Visit
ComfyUI Online
for ready-to-use ComfyUI environment
ComfyUI-ZeroShot-MTrans is an unofficial ComfyUI custom node enabling Zero-Shot Material Transfer from a single image. It transfers material properties (e.g., gold) from an exemplar image to an input image (e.g., an apple) while maintaining accurate lighting and consistency.
ComfyUI-ZeroShot-MTrans Introduction
ComfyUI-ZeroShot-MTrans is an unofficial custom node for ComfyUI that integrates the Zero-Shot Material Transfer (ZeST) technique. ZeST allows you to transfer material properties from one image to another seamlessly. For example, you can take a photo of an apple and apply the texture of a golden bowl to it, maintaining accurate lighting and other details. This extension is particularly useful for AI artists who want to experiment with different textures and materials in their artwork without needing multiple reference images.
The core idea behind ComfyUI-ZeroShot-MTrans is to use a single material exemplar image to transfer its texture onto another image. This process involves several steps:
Material Style Extraction: The extension uses an IP-Adapter to extract the style information from the material exemplar image.
Depth Information Control: It then controls the depth information to ensure that the material is applied correctly, considering the lighting and shadows.
Brightness Adjustment: The extension adjusts the brightness of the target image to match the lighting conditions of the material exemplar.
By combining these steps, ComfyUI-ZeroShot-MTrans can create a new image where the material from the exemplar is applied to the target image, maintaining realistic lighting and details.
ComfyUI-ZeroShot-MTrans Features
Material Transfer
Input Image: The original image you want to apply the new material to.
Material Exemplar: The image containing the material you want to transfer.
Subject Mask: A mask to specify the area where the material should be applied.
Brightness Control: Adjust the brightness to match the lighting conditions of the material exemplar.
Customization Options
Brighter Parameter: This parameter controls the brightness of the target image.
Default (1): No change in brightness.
Less than 1: Darkens the target image, useful for high-light materials.
Greater than 1: Brightens the target image, useful for low-light materials.
Output
IMAGE: The final image with the material applied, ready for further processing or inpainting.
ComfyUI-ZeroShot-MTrans Models
ComfyUI-ZeroShot-MTrans leverages different models to achieve its functionality:
IP-Adapter: Extracts style information from the material exemplar.
ControlNet: Manages depth information to ensure accurate material application.
Segmentation Models: Used for creating subject masks to specify the area of material application.
Each model plays a crucial role in ensuring that the material transfer is realistic and maintains the original image's details.
Troubleshooting ComfyUI-ZeroShot-MTrans
Common Issues and Solutions
Output Image is Too Dark or Too Bright:
Solution: Adjust the brighter parameter. If the image is too dark, increase the value. If it's too bright, decrease the value.
Material Not Applied Correctly:
Solution: Ensure that the subject mask is accurate and only covers the area where the material should be applied.
Inconsistent Lighting:
Solution: Make sure the material exemplar image has consistent lighting. Adjust the brightness parameter to match the lighting conditions.
Frequently Asked Questions
Q: Can I use any image as a material exemplar?
A: Yes, but for best results, use images with clear and consistent material textures.
Q: How do I create a subject mask?
A: You can use any image editing software to create a mask. The mask should be a black and white image where the white area represents the part of the image where the material will be applied.
Learn More about ComfyUI-ZeroShot-MTrans
For more information, tutorials, and community support, you can visit the following resources:
ZeST Code Repository
These resources provide in-depth information about the underlying technology and additional examples to help you get the most out of ComfyUI-ZeroShot-MTrans.