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
* Update ControlNext use case docs
Signed-off-by: Sherlock113 <[email protected]>
* ci: auto fixes from pre-commit.ci
For more information, see https://pre-commit.ci
---------
Signed-off-by: Sherlock113 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* ``SDXLControlNetService``: A BentoML Service with custom configurations in timeout, worker count, and resources.
111
+
classParams(BaseModel):
112
+
prompt: str
113
+
negative_prompt: t.Optional[str]
114
+
controlnet_conditioning_scale: float=0.5
115
+
num_inference_steps: int=25
143
116
144
-
- It loads the three pre-trained models and configures them to use GPU if available. The main pipeline (``StableDiffusionXLControlNetPipeline``) integrates these models.
145
-
- It defines an API endpoint ``generate`` to process a text prompt and an image array. The processed image is converted to a tuple and returned.
117
+
This file defines a BentoML Service ``ControlNet`` with custom :doc:`configurations </guides/configurations>` in timeout, worker count, and resources.
146
118
147
-
* ``Params``: This is a ``pydantic`` model defining the structure for input parameters.
148
-
* ``ControlNet``: A BentoML Service with custom configurations in timeout, worker count, and resources. ``ControlNet`` doesn't create images itself. Instead, it preprocesses the image and forwards it along with the text prompt to the ``SDXLControlNetService`` Service. The ``generate`` method in ``ControlNet`` then returns the final generated image.
119
+
- It loads the three pre-trained models and configures them to use GPU if available. The main pipeline (``StableDiffusionXLControlNetPipeline``) integrates these models.
120
+
- It defines an asynchronous API endpoint ``generate``, which takes an image and a set of parameters as input. The parameters for the generation process are extracted from a ``Params`` instance, a Pydantic model that provides automatic data validation.
121
+
- The ``generate`` method returns the generated image by calling the pipeline with the processed image and text prompts.
149
122
150
123
Run ``bentoml serve`` in your project directory to start the BentoML server.
0 commit comments