{ "cells": [ { "cell_type": "markdown", "id": "070006de", "metadata": {}, "source": [ "# Test ControlNet Model with Gradio UI application\n", "\n", "In this notebook, you will launch a Gradio UI application to provide interactive experience for the user to upload images for model inference in live mode. Note that you need to deploy the model to an endpoint using the other notebook and store the endpoint name in Jupyter server. Otherwise, you can manually define the endpoint name.\n", "\n", "The kernel used is the custom kernel called 'control'. To create the custom conda kernel, please refer to the ReadMe **Step 3**." ] }, { "cell_type": "code", "execution_count": null, "id": "449b7ead", "metadata": {}, "outputs": [], "source": [ "import sys,os\n", "\n", "sys.path.append(\"./container/ControlNet\") \n", "%store -r" ] }, { "cell_type": "code", "execution_count": null, "id": "67c7d159", "metadata": {}, "outputs": [], "source": [ "os.environ['region'] = 'us-east-1'\n", "os.environ['endpoint_name'] = endpoint_name" ] }, { "cell_type": "code", "execution_count": null, "id": "ce7c7e21", "metadata": {}, "outputs": [], "source": [ "from gradio_hed2image import process\n", "import json\n", "import sagemaker" ] }, { "cell_type": "code", "execution_count": null, "id": "a85342fc", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "control", "language": "python", "name": "control" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 5 }