Build Custom Widget
Last updated
Last updated
Reference code:
https://github.com/wl-zhao/proconfig-diffuser-imagen
The code above provides a simple example of calling the DiffusionPipeline
in diffusers. The core code is in:
https://github.com/wl-zhao/proconfig-diffuser-imagen/blob/main/diffuser_widget.py
Define the widget's name and category through NAME
and CATEGORY
.
Define input and output specifications via InputsSchema
and OutputsSchema
. Use pydantic syntax to define the schema for each field.
Implement the execute
function to define the widget's actual execution logic. The function's inputs and outputs need to meet the previously defined input and output specifications.
In the root directory, define __init__.py
(e.g., https://github.com/wl-zhao/proconfig-diffuser-imagen/blob/main/init.py), and import the written widget inside.
You can install it via Install from Git in the Manager.