Skip to content

Commit

Permalink
[SD] Add FastChat as part of SD WebUI (nod-ai#1349)
Browse files Browse the repository at this point in the history
-- This commit includes FastChat as part of SD WebUI.

Signed-off-by: Abhishek Varma <abhishek@nod-labs.com>
Co-authored-by: Abhishek Varma <abhishek@nod-labs.com>
  • Loading branch information
Abhishek-Varma and Abhishek Varma authored Apr 24, 2023
1 parent 09e3f63 commit a5ae9d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/stable_diffusion/web/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def resource_path(relative_path):
dark_theme = resource_path("ui/css/sd_dark_theme.css")

from apps.stable_diffusion.web.ui import (
chatbot_web,
txt2img_web,
txt2img_gallery,
txt2img_sendto_img2img,
Expand Down Expand Up @@ -119,6 +120,8 @@ def register_button_click(button, selectedid, inputs, outputs):
outpaint_web.render()
with gr.TabItem(label="Upscaler", id=4):
upscaler_web.render()
with gr.TabItem(label="Chatbot", id=5):
chatbot_web.render()

with gr.Tabs(visible=False) as experimental_tabs:
with gr.TabItem(label="LoRA Training", id=5):
Expand Down
1 change: 1 addition & 0 deletions apps/stable_diffusion/web/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@
upscaler_sendto_outpaint,
)
from apps.stable_diffusion.web.ui.lora_train_ui import lora_train_web
from apps.stable_diffusion.web.ui.chatbot_ui import chatbot_web
8 changes: 8 additions & 0 deletions apps/stable_diffusion/web/ui/chatbot_ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fastchat import build_demo, get_model_list, set_global_vars

controller_url = "http://localhost:21001"
moderate = False
models = get_model_list(controller_url)
set_global_vars(controller_url, moderate, models)

chatbot_web = build_demo()

0 comments on commit a5ae9d9

Please sign in to comment.