Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Image + Mask Handling Support #87

Closed
Six6pounder opened this issue May 31, 2024 · 2 comments
Closed

Request for Image + Mask Handling Support #87

Six6pounder opened this issue May 31, 2024 · 2 comments

Comments

@Six6pounder
Copy link

Hello,

I would like to request support for handling image + mask pairs in the project. This feature is essential for tasks that involve segmentation or similar image processing requirements.

Feature Request:
Add functionality to process image + mask pairs.

I have noticed that the primary functionality is controlled by the predict.py file. Could you please confirm if implementing this feature requires changes only in this file?

Thank you for considering this request.

@fofr
Copy link
Owner

fofr commented Jun 3, 2024

Do you have a ComfyUI workflow for this?

@Six6pounder
Copy link
Author

Six6pounder commented Jun 3, 2024

def handle_input_file(self, input_file: Path, isMaskFile: bool = False):
...
        if isMaskFile:

                shutil.copy(input_file, os.path.join(INPUT_DIR, f"mask{file_extension}"))
                
                
def predict(
        self,
        mask_file: Path = Input(
            description="Mask image, tar or zip file. Read guidance on workflows and input files here: https://github.com/fofr/cog-comfyui. Alternatively, you can replace inputs with URLs in your JSON workflow and the model will download them.",
            default=None,
        ),
        ....
       if mask_file:
            self.handle_input_file(mask_file, isMaskFile=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants