Skip to content

feat: add imageGeneration param #311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

The `fileConfig` object allows you to configure file handling settings for the application, including size limits and MIME type restrictions. This section provides a detailed breakdown of the `fileConfig` object structure.

There are 3 main fields under `fileConfig`:
There are 4 main fields under `fileConfig`:

- `endpoints`
- `serverFileSizeLimit`
- `avatarSizeLimit`
- `imageGeneration`

**Notes:**

Expand Down Expand Up @@ -50,7 +51,9 @@ fileConfig:
- "image/.*"
serverFileSizeLimit: 1000
avatarSizeLimit: 2

imageGeneration:
percentage: 100
px: 1024
```

## serverFileSizeLimit
Expand All @@ -66,7 +69,6 @@ fileConfig:
serverFileSizeLimit: 1000
```


## avatarSizeLimit

<OptionTable
Expand All @@ -80,6 +82,35 @@ fileConfig:
avatarSizeLimit: 2
```

## imageGeneration

<OptionTable
options={[
['imageGeneration', 'Object', 'Settings related to image generation output quality and dimensions.', 'Allows configuration of either output size as a percentage relative to some base size or as an explicit pixel dimension.'],
]}
/>

`imageGeneration` supports the following parameters:

- `percentage` (Integer)
- The output size of the generated image expressed as a percentage (e.g., `100` means 100% of base size).
- Use this to scale the output image relative to a default or original size.

- `px` (Integer)
- Specifies the output image dimension in pixels (e.g., `1024`).
- Use this to explicitly set the output size of the generated image regardless of base size.

You may set only one of these parameters (`percentage` or `px`), not both, depending on your use case

Example configuration:

```yaml filename="fileConfig / imageGeneration"
fileConfig:
imageGeneration:
percentage: 100
px: 1024
```

## endpoints

<OptionTable
Expand Down