ComfyUI V0.3.67: Fixing PNGInfo & Custom Node Issues
Hey guys! Having issues with ComfyUI version 0.3.67 messing up your PNG info and custom image saving? Specifically, is it affecting your ComfyUI Image Metadata Extension? Well, let's dive into fixing this so you can get back to creating awesome stuff!
Understanding the Problem
So, after upgrading to ComfyUI version 0.3.67, some of you might have noticed that your custom nodes, especially those dealing with image metadata, have gone a bit haywire. The main culprit seems to be the way the new version handles pnginfo, which is crucial for storing extra data in PNG files. This data is often used by platforms like CivitAI to automatically detect things like LoRA models, prompts, and other important details.
Specifically, the ComfyUI Image Metadata Extension, which many of you use to add extra metadata to PNG files for CivitAI compatibility, is throwing error messages. These errors indicate that the prompt and LoRA information is no longer available in the pnginfo_dict. This means that when you save an image with this custom node and upload it to CivitAI, the platform fails to recognize the prompt, LoRA, or model information embedded in the PNG file.
This issue stems from changes in how ComfyUI 0.3.67 handles the pnginfo_dict, which is essentially a dictionary containing all the extra metadata you want to embed in your PNG files. Custom nodes like the ComfyUI Image Metadata Extension rely on this dictionary to add specific information, such as LoRA details and prompt formatting that CivitAI can recognize. When ComfyUI updates, these underlying data structures or APIs can change, causing compatibility issues with existing custom nodes.
The error messages you might be seeing, such as "Positive prompt is empty!", "Steps are empty, full metadata won't be added!", and "Seed not found in pnginfo_dict!", are all symptoms of this underlying problem. They indicate that the custom node is no longer able to access the necessary information from the pnginfo_dict due to changes in ComfyUI's core functionality. This, in turn, prevents the node from properly embedding the metadata in the PNG file, leading to recognition issues on platforms like CivitAI.
To summarize, the core of the issue lies in the incompatibility between the ComfyUI Image Metadata Extension and the updated way ComfyUI 0.3.67 handles the pnginfo_dict. This incompatibility prevents the custom node from correctly embedding metadata in PNG files, causing platforms like CivitAI to fail to recognize crucial information such as LoRA models and prompts. Understanding this fundamental issue is the first step towards finding a solution and getting your custom nodes back up and running smoothly.
Diagnosing the Issue
Okay, so you're facing this problem. What's the first step? Let's troubleshoot like pros:
- Disable Custom Nodes: The golden rule of ComfyUI troubleshooting! Go to your ComfyUI folder and rename the 
custom_nodesfolder to something like_custom_nodes. Restart ComfyUI. Does the issue go away? If so, it's definitely a custom node causing the problem. - Identify the Culprit: If disabling all custom nodes fixes the issue, re-enable them one by one to pinpoint which one is causing the trouble. In this case, it's likely the ComfyUI Image Metadata Extension, but it's always good to double-check.
 - Check for Updates: Head over to the ComfyUI Image Metadata Extension GitHub page. Is there an update available? Custom node developers are usually quick to fix compatibility issues after ComfyUI updates.
 - Examine the Error Logs: The error logs you posted are super helpful! They tell us that the node is having trouble accessing the prompt, steps, and seed information from the 
pnginfo_dict. This gives us a clue about where to focus our efforts. 
Potential Solutions and Workarounds
Alright, let's get down to brass tacks. Here's what you can do to fix this mess:
- 
Update the Custom Node: This is the easiest and most likely solution. If the developer has released an update, install it! Use the ComfyUI Manager or manually update the node from the GitHub repository.
- Using ComfyUI Manager: Open the ComfyUI Manager, go to "Update All", and see if there's an update for the ComfyUI Image Metadata Extension. If so, update it and restart ComfyUI.
 - Manual Update: Go to the ComfyUI Image Metadata Extension GitHub page, download the latest version, and replace the files in your 
custom_nodes/comfyui_image_metadata_extensionfolder. Restart ComfyUI. 
 - 
Manual Data Entry (Temporary Workaround): If updating doesn't work or there's no update available yet, you can manually add the missing information to the PNG file using other tools.
- PNG Metadata Editors: Use a PNG metadata editor (like 
exiftool) to manually add the prompt, LoRA, and model information to the PNG file before uploading it to CivitAI. This is tedious but can get you by in the short term. 
 - PNG Metadata Editors: Use a PNG metadata editor (like 
 - 
Modify the Custom Node (Advanced): If you're comfortable with Python, you can dive into the node's code and try to fix the issue yourself.
- Examine the Code: Look at how the node accesses the 
pnginfo_dict. Compare it to how other nodes access this dictionary in ComfyUI 0.3.67. You might need to adjust the code to be compatible with the new version. - Adapt to Changes: Identify the specific changes in ComfyUI that are causing the issue and adapt the node's code accordingly. This might involve updating the way the node retrieves or sets metadata in the 
pnginfo_dict. 
Remember to back up the original code before making any changes, and be careful not to introduce new errors.
 - Examine the Code: Look at how the node accesses the 
 - 
Downgrade ComfyUI (Last Resort): If all else fails, you can downgrade to a previous version of ComfyUI where the node was working correctly. However, this is not ideal, as you'll miss out on the latest features and bug fixes.
- Using Git: If you installed ComfyUI using Git, you can use the 
git checkoutcommand to revert to a previous commit. Find a commit before version 0.3.67 and check it out. 
 - Using Git: If you installed ComfyUI using Git, you can use the 
 
Diving Deeper: Code Modifications (For the Brave)
If you're feeling adventurous, you can try modifying the custom node's code. Here's a general idea of what you might need to do:
- Inspect the 
pnginfo_dictAccess: Look for the parts of the code where the node accesses thepnginfo_dict. Are the keys still the same? Has the structure of the dictionary changed? - Adapt to API Changes: ComfyUI might have changed the API for accessing or modifying image metadata. Check the ComfyUI documentation or other custom nodes to see how they handle 
pnginfoin version 0.3.67. - Handle Missing Data: Add error handling to gracefully handle cases where the prompt, steps, or seed information is missing. This will prevent the node from crashing and provide more informative error messages.
 
Here's a simplified example of what the code modification might look like:
# Original code (may not work in ComfyUI 0.3.67)
prompt = pnginfo_dict["prompt"]
# Modified code (more robust)
try:
    prompt = pnginfo_dict["prompt"]
except KeyError:
    print("[ComfyUI Image Metadata Extension] WARNING: Prompt not found in pnginfo_dict!")
    prompt = ""
This example adds a try-except block to handle the case where the "prompt" key is not found in the pnginfo_dict. This prevents the node from crashing and allows it to continue processing the image, even if the prompt information is missing.
Preventing Future Issues
To avoid similar issues in the future, here are a few tips:
- Stay Updated: Keep your custom nodes updated with the latest versions. Developers often release updates to address compatibility issues after ComfyUI updates.
 - Monitor ComfyUI Changes: Keep an eye on the ComfyUI release notes and changelogs to be aware of any changes that might affect your custom nodes.
 - Test After Updates: After updating ComfyUI, test your custom nodes to ensure they're still working correctly. This will help you catch any compatibility issues early on.
 - Join the Community: Engage with the ComfyUI community on forums, Discord, or GitHub. This is a great way to learn about potential issues and solutions.
 
Conclusion
Alright, we've covered a lot! Hopefully, this guide has given you a clear understanding of the issue, how to diagnose it, and potential solutions. Remember, the key is to stay updated, test after updates, and engage with the ComfyUI community. Good luck, and happy creating!
By following these steps, you should be able to resolve the pnginfo and custom node issues in ComfyUI version 0.3.67 and get back to generating awesome images with all the correct metadata. Remember to always back up your work and stay informed about the latest updates in the ComfyUI ecosystem.