Repository navigation
Chat
Chat is a user interface that allows you to interact with the system in a conversational manner

Note
Chat is currently implemented for image generation workflows
Chat session represents a single conversation with the system:
- You can list, activate, create, delete, rename chat sessions
- Chat sessions are persistent and stored in the chat database
- All chat parameters are stored and activated per-session
Tip
You can have separate sessions for different projects that have different model parameters switching between them will activate the corresponding parameters for each session
Things that are stored per chat session include:
- Active context
- Server settings
- Model selection
- Process parameters
- Uploaded images
- Chat history
Important
Chat parameters are maintained separately and do not rely on UI state
Warning
Uploaded images are stored as references
If you clear your chat storage location, the uploaded images may no longer be available
Chat messages represent individual interactions within a chat session:
- Messages are stored in the chat database and associated with their respective session
- Chat interface is a rich-media interface
You can upload, drag&drop or paste images directly into the chat messages - Chat messages can also read a text file as a script
Same commands work when scripted or entered interactively.
Run help for a list of available chat commands and their usage.
Choose a context and control active work
- title
[name]: Read or set the current session name - context
<value>: Select the active context - clear: Clear displayed messages without changing session history
- run
[count]: Run image generation 1-10 times (default: 1) - generate/start: Start the current process once
- schedule: Add the current image or video generation to the scheduler
- cancel/abort/stop/interrupt: Stop the current process
- pause: Pause the current process
- resume: Resume a paused process
- skip: Skip the current item
- history [limit]: Show recent process history
- last/details: Show active parameters from the last processing run
Set, inspect, and reset context parameters
- prompt
<value>: Set the prompt - negative
<value>: Set the negative prompt - set
[key] [value]: Set a value or list session values - get
[key]: Get a value or list session values - params/args: List valid parameter keys for the current context
- reset: Restore parameter defaults
Upload and manage reference images and command text
- use/file
<path>: Import a server-local text or image file - image list: List available session images
- image save: Save all images from the latest result batch
- image
<number[,number...]>: Select one or more images as active inputs - image reuse: Select results image as next input image
- image clear: Clear active image inputs
- meta/exif/metadata: Inspect metadata for the last image
List available options
- list
key: Show valid choices
Read or change settings shared across sessions
- model
[model] [unet]: Show or change the model and optional UNet - opts
[key] [value]: Read or update global options
Query runtime, device, memory, and storage details
- info/ver/version: Show runtime version details
- gpu/smi: Show GPU metrics
- mem/memory: Show RAM, CUDA, and model usage
- status: Show server status and progress
- storage: Show storage usage
- db: Compact the Chat database and show database statistics
Example session commands
Upload it to chat using "Attach file", drag & drop, copy & paste
Or Refer to the file by path for example: file tmp/chat.txt
Or simply type those commands directly into the chat in a conversational manner
# check system
info
gpu
mem
# set session
title test session
model tempestByVlad_hyperV01
context image
# set globals
opts samples_save false
# set params
reset
image clear
set steps 8
set cfg_scale 1
set sampler UniPC
set detailer_enabled true
set width 960
set height 1280
set styles "Cycle Style"
# print active parameters
set
# set prompt
prompt "cute android on a futuristic city rooftop at sunset"
# run generate
run
# post generate
image save
details
metadata
# re-run with batch
opts samples_save true
run 5
info title edit session
# load edit model as we can use multiple reference images
# model will be matched based on string dont need to enter full name
model klein-9b
# upload images using path, you can also drag & drop or paste them directly into the chat
file path/to/first_image.jpg
file path/to/second_image.jpg
# check if images are both present
image list
# select both
image 1,2
# set prompt
prompt "change the background in the first image to match the second image"
# run generate
generate
# set result image as input image for further edits
image reuse
prompt "change hair color to blonde"
generateChat has only the following settings:
- Chat enabled: globally enable/disable chat feature
- Chat upload directory: specify the folder for chat artifacts; leave empty for default temporary location
- Chat database directory: specify the folder for chat database; leave empty for default location
models/chat
- Uses SQLite as its underlying database for storing chat history and metadata
- Stores chat artifacts such as uploaded files and generated images in the specified directory
- Uses SD.Next API for all operations, no dependency on Gradio
- Available in ModernUI or via API, not available in StandardUI
Chat endpoints use the /sdapi/v1/chat prefix and are grouped under the Chat tag in the generated OpenAPI documentation.
-
GET/POST/sessions: List or create sessions -
GET/PATCH/DELETE/sessions/{session_id}: Read, update, or delete a session;POST/sessions/{session_id}/restorerestores it -
POST/sessions/{session_id}/messages: Submit a message or command;PATCH/sessions/{session_id}/messages/{message_id}edits a message -
POST/sessions/{session_id}/files: Upload a file to a session -
/sessions/{session_id}/artifacts/{artifact_id}routes provide artifact content (GET .../content), open-folder and save actions (POST), and deletion (DELETE)
- Prompt-vs-Command mode
- Chat support for video workflow (partially implemented)
- Chat support for Caption workflow
- Chat support for Process workflow
- Kanvas edit for images
- Add OpenAI compatible API endpoints
- Augment chat with LLM capabilities
- Highlighting support for prompts