Authored by ahernandezmiro
Created 23 days ago
Updated 18 days ago
READMEComfyUI Custom Nodes for GCP
This repository contains a module with two custom nodes for ComfyUI that enable seamless interaction with Google Cloud Platform (GCP). These nodes allow you to:
Read Images from GCP : Fetch images from a GCP bucket.
Write Images to GCP : Upload images to a GCP bucket.
Both nodes support authentication using your GCP credentials file in JSON format.
Features
Specify the bucket name and the image file name and path to read/write from.
Authentication via GCP credentials file.
Installation
Clone this repository into your custom_nodes
directory within your ComfyUI installation:
git clone https://github.com/ahernandezmiro/ComfyUI-GCP_Storage_tools /path/to/ComfyUI/custom_nodes/gcp_nodes
Install the required dependencies:
pip install google-cloud-storage
Restart ComfyUI.
Usage
Prepare Your GCP Credentials
Obtain your GCP credentials in JSON format from the GCP Console .
Save the credentials file locally on your system.
Set the Credentials Directory
Each node requires the full path to your GCP credentials file. This can be specified in the node's input fields.
Use the Nodes in ComfyUI
Add the "Read Images from GCP" or "Write Images to GCP" node to your workflow.
Configure the required fields such as bucket name, file name/path, and credentials file directory.
Example Workflow
Reading an Image from GCP
Add the "Read Images from GCP" node.
Configure the following:
Bucket Name : Your GCP bucket name.
File Path : Path to the image file within the bucket.
File Name : Name of the image file within the bucket path.
Credentials File Path : Full path to your GCP credentials JSON file.
Connect the node to your workflow to fetch and use the image.
Writing an Image to GCP
Add the "Write Images to GCP" node.
Configure the following:
Bucket Name : Your GCP bucket name.
Destination File Path : Path where the image should be stored in the bucket.
File Name : Name of the image file to be stored in the bucket.
Credentials File Path : Full path to your GCP credentials JSON file.
Connect the node to your workflow to upload images to GCP.
Requirements
Python 3.7+
google-cloud-storage
Python library
GCP account with access to a storage bucket
Troubleshooting
Missing or Incorrect Credentials
Ensure your GCP credentials file is in JSON format.
Verify the file path specified in the node's input.
Permission Errors
Ensure your GCP account has the appropriate permissions for the bucket.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions
Contributions are welcome! Feel free to submit issues or pull requests to improve the functionality of these nodes.
Acknowledgments