Skip to content

Commit 9d969f8

Browse files
committed
Update ai-server docs
1 parent 108a9d7 commit 9d969f8

File tree

6 files changed

+138
-122
lines changed

6 files changed

+138
-122
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```csharp
2+
var request = new ImageToText() { };
3+
4+
var response = client.PostFilesWithRequest<GenerationResponse>(
5+
request,
6+
[new UploadFile("image", File.OpenRead("files/test_image.jpg"), "image")]
7+
);
8+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```csharp
2+
var request = new QueueImageToText() { };
3+
4+
var response = client.PostFilesWithRequest<QueueGenerationResponse>(
5+
request,
6+
[new UploadFile("image", File.OpenRead("files/test_image.jpg"), "image")]
7+
);
8+
```

MyApp/_pages/ai-server/sidebar.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
"link": "/ai-server/usage/chat"
3131
},
3232
{
33-
"text": "Text to Image",
34-
"link": "/ai-server/usage/text-to-image"
33+
"text": "Image Generation",
34+
"link": "/ai-server/usage/image-generation"
3535
},
3636
{
37-
"text": "Video",
38-
"link": "/ai-server/usage/video"
37+
"text": "Image Transforms",
38+
"link": "/ai-server/usage/image"
3939
},
4040
{
41-
"text": "Image Endpoints",
42-
"link": "/ai-server/usage/image-endpoints"
41+
"text": "Video Transforms",
42+
"link": "/ai-server/usage/video"
4343
},
4444
{
45-
"text": "Audio Endpoints",
46-
"link": "/ai-server/usage/audio-endpoints"
45+
"text": "Speech",
46+
"link": "/ai-server/usage/speech"
4747
}
4848
]
4949
}

MyApp/_pages/ai-server/usage/image-endpoints.md

Lines changed: 0 additions & 114 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Image Generation
3+
description: Generating images with AI Server using ComfyUI workflows
4+
---
5+
6+
AI Server has built-in ComfyUI workflows for performing image generation tasks using AI models like SDXL and Flux.
7+
8+
The following tasks are available for image generation:
9+
10+
- **Text to Image**: Generate an image based on provided text prompts.
11+
- **Image to Image**: Generate a new image based on an input image and provided prompts.
12+
- **Image with Mask**: Generate a new image based on an input image, a mask, and provided prompts (applied only to the masked area).
13+
- **Image Upscale**: Upscale an input image to a higher resolution (currently 2x only).
14+
15+
## Using Image Generation Endpoints
16+
17+
These endpoints are used in a similar way to other AI Server endpoints. You can provide a RefId and Tag to help categorize the request, and for Queue requests, you can provide a ReplyTo URL to send a POST request to when the request is complete.
18+
19+
### Text to Image {#text-to-image}
20+
21+
::include ai-server/cs/text-to-image-1.cs.md::
22+
23+
### Queue Text to Image {#queue-text-to-image}
24+
25+
::include ai-server/cs/queue-text-to-image-1.cs.md::
26+
27+
### Image to Image {#image-to-image}
28+
29+
::include ai-server/cs/image-to-image-1.cs.md::
30+
31+
### Queue Image to Image {#queue-image-to-image}
32+
33+
::include ai-server/cs/queue-image-to-image-1.cs.md::
34+
35+
### Image with Mask {#image-with-mask}
36+
37+
::include ai-server/cs/image-with-mask-1.cs.md::
38+
39+
### Queue Image with Mask {#queue-image-with-mask}
40+
41+
::include ai-server/cs/queue-image-with-mask-1.cs.md::
42+
43+
### Image Upscale {#image-upscale}
44+
45+
::include ai-server/cs/image-upscale-1.cs.md::
46+
47+
### Queue Image Upscale {#queue-image-upscale}
48+
49+
::include ai-server/cs/queue-image-upscale-1.cs.md::
50+
51+
## Additional Functionality
52+
53+
AI Server also provides Image-To-Text generation using the ComfyUI Agent that utilizes the [Florence 2 model](https://huggingface.co/microsoft/Florence-2-base). The ComfyUI Agent must have this model downloaded and installed to support this functionality.
54+
55+
### Image to Text {#image-to-text}
56+
57+
::include ai-server/cs/image-to-text-1.cs.md::
58+
59+
### Queue Image to Text {#queue-image-to-text}
60+
61+
::include ai-server/cs/queue-image-to-text-1.cs.md::
62+
63+
Note: Ensure that the ComfyUI Agent has the Florence 2 model downloaded and installed for the Image-To-Text functionality to work.

MyApp/_pages/ai-server/usage/image.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Image Endpoints
3+
description: Processing images with AI Server
4+
---
5+
6+
AI Server incorporates various image processing capabilities. It wraps some common operations into easier-to-use endpoints, such as:
7+
8+
- **Crop Image**: Crop an image to a specific size.
9+
- **Convert Image**: Convert an image to a different format.
10+
- **Scale Image**: Scale an image to a different resolution.
11+
- **Watermark Image**: Add a watermark to an image.
12+
13+
:::info
14+
These operations are processed on the AI Server itself, rather than an external API or agent.
15+
:::
16+
17+
## Using Image Endpoints
18+
19+
These endpoints are used in a similar way to the other AI Server endpoints, e.g., you can provide a RefId and Tag to help categorize the request, and for Queue requests, you can provide a ReplyTo URL to send a POST request to when the request is complete.
20+
21+
### Crop Image {#crop-image}
22+
23+
::include ai-server/cs/crop-image-1.cs.md::
24+
25+
### Queue Crop Image {#crop-image}
26+
27+
::include ai-server/cs/queue-crop-image-1.cs.md::
28+
29+
### Convert Image {#convert-image}
30+
31+
::include ai-server/cs/convert-image-1.cs.md::
32+
33+
### Queue Convert Image {#convert-image}
34+
35+
::include ai-server/cs/queue-convert-image-1.cs.md::
36+
37+
### Scale Image {#scale-image}
38+
39+
::include ai-server/cs/scale-image-1.cs.md::
40+
41+
### Queue Scale Image {#scale-image}
42+
43+
::include ai-server/cs/queue-scale-image-1.cs.md::
44+
45+
### Watermark Image {#watermark-image}
46+
47+
::include ai-server/cs/watermark-image-1.cs.md::
48+
49+
### Queue Watermark Image {#watermark-image}
50+
51+
::include ai-server/cs/queue-watermark-image-1.cs.md::

0 commit comments

Comments
 (0)