-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[Docs] ELI5 Tutorial For Invocations #3524
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
[Docs] ELI5 Tutorial For Invocations #3524
Conversation
This type of documentation is going to be critical. Thanks for putting it together. I've given it a once over, but will get perspective of @brandonrising next week on how clear it is to fresh eyes, and where we can expand. |
933f00f
to
aefbd6d
Compare
``` | ||
|
||
As you might have noticed, we added two new parameters to the field type for | ||
`width` and `height` called `gt` and `le`. These basically stand for _greater |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Says gt
and le
here, but in the code snippet above, height and width have ge
instead of gt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Thanks for spotting that. I'll fix it up.
) | ||
``` | ||
|
||
**Note:** Do not be overwhelmed by the `ImageOutput` process. InvokeAI has a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be great one day to add a doc reference here that explains all the services available when writing invocations (image.create/images.get_pil_image/etc). For now, maybe we could add a note pointing to invocation_services.py as a starting point for available utilities while working on invocations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. We can maintain a doc with available services and some small snippets on how to use them. Once we have the model manager finished and merged in, we should have more details on how to frame that.
|
||
- There is no naming convention for input fields but we highly recommend that | ||
you name it something appropriate like `ColorField`. | ||
- It is not mandatory but it is heavily recommended to add a relevant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should make this mandatory haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about it too. The only mandatory thing right now is Invocation
coz we use that in the UI to actually parse the name of the node but maybe it wont hurt to enforce this. We might not have any code related validators for it but because every node has to go through a review anyway, we could probably enforce it.
@psychedelicious Thoughts? Should we make devs use Field
and Output
to describe the respective types and fields?
- Keep your field in the same file as the Invocation that it is made for or in | ||
another file where it is relevant. | ||
|
||
All input types a class that derive from the `BaseModel` type from `pydantic`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All input types a class that derive from the `BaseModel` type from `pydantic`. | |
All input types are classes that derive from the `BaseModel` type from `pydantic`. |
``` | ||
|
||
Perfect. Now let us create our custom inputs for our field. This is exactly | ||
similar how you created input fields for your Invocation. All the same rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar how you created input fields for your Invocation. All the same rules | |
the same as how you created input fields for your Invocation. All the same rules |
This looks great! Definitely valuable and worth investing in. One question for the advanced section probably, are invocations allowed to use FWIW - I'm planning on writing a blog post or two about converting some arbitrary paper's sample code into an invocation. Probably SAM (or a variant) and Deep Floyd. Started to do that already but figured I should wait until the new model management stuff is in. |
|
Yes. I'll update this when I'm refining the PR later. I'm just waiting on all the services to settle in.
Basically we'll want the dev to access the config via the service rather than trying to instantiate their own class of |
@blessedcoolant - Thoughts on the status/timing of this doc? Have it on the list of things to have ready for 3.0 launch |
The docs are good for the backend stuff. They front end stuff is still WIP. But that's a big write up. So don't really have an ETA on that. |
Ok - should we merge this in then? Or can merge over to the doc-updates branch if you want |
Yeah. Soak it into that. When I do more documentation for the front end stuff, I can build on that. But that'll have to wait for a bit. |
aefbd6d
to
f18fc94
Compare
Work in progress. Just putting it out there to see if its worth pursuing writing indepth detailed guides.
Can be previewed here: https://github.com/blessedcoolant/InvokeAI/blob/docs-invocations/docs/contributing/INVOCATIONS.md