You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cog.Path object is used to get files in and out of models. It represents a path to a file on disk. Path is used for all files, regardless of whether they're text files, zip files, videos, images, audio files, etc.
What kind of file does the model want? 🤷🏼
When looking at the schema for a model, it's not easy to tell what type of file is expected:
SDXL's mask input expects an image file, but that's not clear from the schema. Unless the model author writes a description that says what kind of file is expected, users of the model can't reliably know what's expected:
{
"type": "string",
"title": "Mask",
"format": "uri",
"x-order": 3,
"description": "Input mask for inpaint mode. Black areas will be preserved, white areas will be inpainted."
}
fromcogimportBasePredictor, Input, ImagePathclassPredictor(BasePredictor):
defpredict(
self,
mask: ImagePath=Input(
description="Input mask for inpaint mode. Black areas will be preserved, white areas will be inpainted.",
default=None,
)
)
This may be a naive suggestion about how to approach making input and output types more apparent to model consumers, but I'm open to other ideas that address the issue.
The text was updated successfully, but these errors were encountered:
zeke
changed the title
Introducing more specific input and output types for images, audio, video, etc
Let model authors specify filetypes for inputs and outputs (audio, video, image, etc)
Oct 18, 2023
The
cog.Path
object is used to get files in and out of models. It represents a path to a file on disk.Path
is used for all files, regardless of whether they're text files, zip files, videos, images, audio files, etc.What kind of file does the model want? 🤷🏼
When looking at the schema for a model, it's not easy to tell what type of file is expected:
SDXL's
mask
input expects an image file, but that's not clear from the schema. Unless the model author writes a description that says what kind of file is expected, users of the model can't reliably know what's expected:Being explicit about file types
What if, instead of defining the mask in the predictor as a
Path
, it could be anImagePath
, which would really just be aPath
under the hood with some extra constraints?This may be a naive suggestion about how to approach making input and output types more apparent to model consumers, but I'm open to other ideas that address the issue.
Related issues:
The text was updated successfully, but these errors were encountered: