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
Copy file name to clipboardExpand all lines: MyApp/_pages/ai-server/comfy-extension.md
+20-37Lines changed: 20 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,49 +13,31 @@ Since a lot of AI workloads require GPUs or other specialized hardware, the Comf
13
13
14
14
## Installing the ComfyUI Agent
15
15
16
-
To install this more easily, [we have put together a Docker image and a Docker Compose file](https://github.com/serviceStack/agent-comfy) that you can use to get started with ComfyUI Agent in AI Server that is already bundled with the pretty simple extension, and all the necessary dependencies.
16
+
To install this more easily, you can use the `install.sh` script in the ComfyUI Agent repository. This works the same way as the AI Server installer, and will prompt you for the necessary configuration options.
17
17
18
-
### Running the ComfyUI Agent
18
+
This installer supports both local and remote installations, and will ask you for the necessary configuration options including the Auth Secret for your AI Server instance. The install process will then register the ComfyUI Agent with your AI Server instance, enabling it for the model selections you make during the installation.
19
19
20
-
To run the ComfyUI Agent, you can use the following steps:
1.**Clone the Repository**: Clone the ComfyUI Agent repository from GitHub.
26
+
This process will also persist the configuration in the `.env` file in the ComfyUI Agent directory, so you can easily restart the ComfyUI Agent with the same configuration.
2. **Edit the example.env File**: Update the example.env file with your desired settings.
29
-
30
-
```sh
31
-
cp example.env .env
32
-
```
33
-
34
-
And then edit the `.env` file with your desired settings:
35
-
36
-
```sh
37
-
DEFAULT_MODELS=sdxl-lightning,flux-schnell
38
-
API_KEY=your_agent_api_key
39
-
HF_TOKEN=your_hf_token
40
-
CIVITAI_TOKEN=your_civitai_api_key
41
-
```
42
-
43
-
3. **Run the Docker Compose**: Start the ComfyUI Agent with Docker Compose.
28
+
:::info
29
+
On the first run, the ComfyUI Agent will download the models you selected during the installation process. This can take some time depending on the size of the models and your internet connection speed.
30
+
:::
44
31
45
-
```sh
46
-
docker compose up
47
-
```
48
-
49
32
### .env Configuration
50
33
51
34
The `.env` file is used to configure the ComfyUI Agent during the initial setup, and is the easiest way to get started.
52
35
53
-
The keys available in the `.env` file are:
54
-
55
-
- **DEFAULT_MODELS**: Comma-separated list of models to load on startup. This will be used to automatically download the models and their related dependencies. The full list of options can be found on your AI Server at `/lib/data/media-models.json`.
56
-
- **API_KEY**: This is the API key that will be used by your AI Server to authenticate with the ComfyUI. If not provided, there will be no authentication required to access your ComfyUI Agent instance.
57
-
- **HF_TOKEN**: This is the Hugging Face token that will be used to authenticate with the Hugging Face API when trying to download models. If not provided, models requiring Hugging Face authentication like those with user agreements will not be downloaded.
58
-
- **CIVITAI_TOKEN**: This is the Civitai API key that will be used to authenticate with the Civitai API when trying to download models. If not provided, models requiring Civitai authentication like those with user agreements will not be downloaded.
Models requiring authentication to download are also flagged in the `/lib/data/media-models.json` file.
@@ -66,8 +48,9 @@ Models requiring authentication to download are also flagged in the `/lib/data/m
66
48
Once the ComfyUI Agent is running, you can access the ComfyUI Agent instance at [http://localhost:7860](http://localhost:7860) and can be used as a standard ComfyUI.
67
49
The AI Server has pre-defined workflows to interact with your ComfyUI Agent instance to generate images, audio, text, and more.
68
50
69
-
These workflows are found in the AI Server AppHost project under `workflows`. These are templated JSON versions of workflows you save in the ComfyUI web interface.
51
+
### Overriding Workflows
70
52
71
-
### Advanced Configuration
53
+
These workflows are found in the AI Server AppHost project under `workflows`. These are templated JSON versions of workflows you save in the ComfyUI web interface.
72
54
73
-
ComfyUI workflows can be changed or overridden on a per model basis by editing the `workflows` folder in the AI Server AppHost project. Flux Schnell is an example of overriding text-to-image forjust a single workflow for which the code can be foundin`AiServer/Configure.AppHost.cs`.
55
+
You can override these workflows by creating a new JSON file with the same name and path but in the `App_Data/overrides` folder. For example, to override the `text_to_image` workflow, you would create a file at `App_Data/overrides/text_to_image.json`.
56
+
This would override all calls that use text-to-image workflow sent to your ComfyUI Agent instance. You can also override just `flux-schnell` by creating a file at `App_Data/overrides/flux1/text_to_image.json`, and Stable Diffusion 3.5 at `App_Data/overrides/sd35/text_to_image.json`.
Copy file name to clipboardExpand all lines: MyApp/_pages/ai-server/configuration.md
+42-28Lines changed: 42 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,47 +2,48 @@
2
2
title: Configuring AI Server
3
3
---
4
4
5
-
AI Server makes orchestration of various AI providers easy by providing a unified gateway to process LLM, AI, and image transformation requests.
6
-
It comes with an Admin Portal that allows you to configure your AI providers and generate API keys to control access.
5
+
AI Server can be configured in several ways:
7
6
8
-
## Accessing the Admin Portal
7
+
-**install.sh Script**: Run the `install.sh` script to set up the AI Server and ComfyUI Agent.
8
+
-**.env File**: Update the `.env` file with your API keys and run the AI Server for the first time.
9
+
-**Admin Portal**: Use the Admin Portal to add, edit, or remove AI Providers and generate AI Server API keys.
9
10
10
-
Running AI Server will land you on a page showing access to:
11
+
## Running the Installer
11
12
12
-
-**[Admin Portal](http://localhost:5005/admin)**: Centralized management of AI providers and API keys.
13
-
-**[Admin UI](http://localhost:5005/admin-ui)**: ServiceStack built in Admin UI to manage your AI Server.
14
-
-**[API Explorer](http://localhost:5005/ui)**: Explore and test the AI Server API endpoints in a friendly UI.
15
-
-**[AI Server Documentation](https://docs.servicestack.net/ai-server/)**: Detailed documentation on how to use AI Server.
13
+
The `install.sh` script is the quickest way to get AI Server up and running with the default configuration. This is ideal for local development and testing.
16
14
17
-
:::info
18
-
The default credentials to access the Admin Portal are `p@55wOrd`, this can be changed in your `.env` file by setting the `AUTH_SECRET` key.
19
-
:::
20
-
21
-
## Configuring AI Providers
15
+
To run the installer:
22
16
23
-
AI Providers are the external LLM based services like OpenAI, Google, Mistral etc that AI Server interacts with to process Chat requests.
The installer will prompt you to configure your AI Providers and optionally add the ComfyUI Agent.
26
24
27
-
1.**.env File**: Update the `.env` file with your API keys and run the AI Server for the first time.
28
-
2.**Admin Portal**: Use the Admin Portal to add, edit, or remove AI Providers and generate AI Server API keys.
25
+
## `.env` Configuration
29
26
30
-
The provided `install.sh` script will prompt you to configure your AI Providers during the initial setup and populate the same .env file.
27
+
The installer populates the `.env` file with the choices you made during the installation script. You can also manually configure the `.env` file with your API keys and settings.
31
28
32
-
### Using the .env File
29
+
```sh
30
+
OPENAI_API_KEY=your_openai_api_key
31
+
ANTHROPIC_API_KEY=your_anthropic_api_key
32
+
AUTH_SECRET=p@55wOrd
33
+
ASSETS_BASE_URL=http://localhost:5006
34
+
```
33
35
34
-
The `.env` file is used to configure AI Providers during the initial setup of AI Server, and is the easiest way to get started.
36
+
After these values are set in your `.env` file, you can run the AI Server for the first time via docker compose:
35
37
36
-
The .env file is located in the root of the AI Server repository and contains the following keys:
38
+
```sh
39
+
docker compose up
40
+
```
37
41
38
-
-**OPENAI_API_KEY**: OpenAI API Key
39
-
-**ANTHROPIC_API_KEY**: Anthropic API Key
40
-
-**GOOGLE_API_KEY**: Google Cloud API Key
41
-
-**OPENROUTER_API_KEY**: OpenRouter API Key
42
-
-**MISTRAL_API_KEY**: Mistral API Key
43
-
-**GROQ_API_KEY**: GROQ API Key
42
+
This will perform an initial setup, saving providers configuration in the SQLite database. From here, you can manage your AI Providers via the [Admin Portal](http://localhost:5006/admin).
44
43
45
-
Providing the API keys in the .env file will automatically configure the AI Providers when you run the AI Server for the first time.
44
+
:::info
45
+
The default credentials to access the Admin Portal are `p@55wOrd`, this can be changed in your `.env` file by setting the `AUTH_SECRET` key.
46
+
:::
46
47
47
48
### Using the Admin Portal
48
49
@@ -66,6 +67,19 @@ AI Server supports the following AI Providers:
66
67
-**GROQ**: GROQ API
67
68
-**Ollama**: Ollama API
68
69
70
+
Media Providers can also be configured in the Admin Portal. These include:
71
+
72
+
-**ComfyUI**: ComfyUI Agent
73
+
-**Image Generation**
74
+
-**Text-to-Speech**
75
+
-**Speech-to-Text**
76
+
-**Video & Image Processing**
77
+
-**Replicate**: Replicate API
78
+
-**Image Generation**
79
+
-**OpenAI**: OpenAI API
80
+
-**Image Generation**
81
+
-**Text-to-Speech**
82
+
69
83
## Generating AI Server API Keys
70
84
71
85
API keys are used to authenticate requests to AI Server and are generated via the Admin Portal.
0 commit comments