Build Custom Widget
Development
Example
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
Development Process
Define the widget's name and category through
NAMEandCATEGORY.Define input and output specifications via
InputsSchemaandOutputsSchema. Use pydantic syntax to define the schema for each field.Implement the
executefunction 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.
Usage
You can install it via Install from Git in the Manager.

Last updated