Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0d3dde78
authored
Jul 18, 2025
by
Xyfacai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(image): 只有 dalle模型才受 size、quality 影响价格
parent
9f957da5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
relay/image_handler.go
+4
-1
No files found.
relay/image_handler.go
View file @
0d3dde78
...
...
@@ -145,6 +145,9 @@ func ImageHelper(c *gin.Context) (newAPIError *types.NewAPIError) {
}
else
{
sizeRatio
:=
1.0
qualityRatio
:=
1.0
if
strings
.
HasPrefix
(
imageRequest
.
Model
,
"dall-e"
)
{
// Size
if
imageRequest
.
Size
==
"256x256"
{
sizeRatio
=
0.4
...
...
@@ -156,13 +159,13 @@ func ImageHelper(c *gin.Context) (newAPIError *types.NewAPIError) {
sizeRatio
=
2
}
qualityRatio
:=
1.0
if
imageRequest
.
Model
==
"dall-e-3"
&&
imageRequest
.
Quality
==
"hd"
{
qualityRatio
=
2.0
if
imageRequest
.
Size
==
"1024x1792"
||
imageRequest
.
Size
==
"1792x1024"
{
qualityRatio
=
1.5
}
}
}
// reset model price
priceData
.
ModelPrice
*=
sizeRatio
*
qualityRatio
*
float64
(
imageRequest
.
N
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment