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
bc2b1112
authored
Mar 14, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: reroll action error
parent
da55c56c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
model/ability.go
+6
-1
service/midjourney.go
+5
-2
web/src/pages/Channel/EditChannel.js
+1
-1
No files found.
model/ability.go
View file @
bc2b1112
...
...
@@ -147,7 +147,12 @@ func FixAbility() (int, error) {
return
0
,
err
}
var
channels
[]
Channel
err
=
DB
.
Where
(
"id NOT IN (?)"
,
abilityChannelIds
)
.
Find
(
&
channels
)
.
Error
if
len
(
abilityChannelIds
)
==
0
{
err
=
DB
.
Find
(
&
channels
)
.
Error
}
else
{
err
=
DB
.
Where
(
"id NOT IN (?)"
,
abilityChannelIds
)
.
Find
(
&
channels
)
.
Error
}
if
err
!=
nil
{
return
0
,
err
}
...
...
service/midjourney.go
View file @
bc2b1112
...
...
@@ -45,7 +45,7 @@ func GetMjRequestModel(relayMode int, midjRequest *dto.MidjourneyRequest) (strin
case
relayconstant
.
RelayModeMidjourneyTaskFetch
,
relayconstant
.
RelayModeMidjourneyTaskFetchByCondition
,
relayconstant
.
RelayModeMidjourneyNotify
:
return
""
,
nil
,
true
default
:
return
""
,
MidjourneyErrorWrapper
(
constant
.
MjRequestError
,
"unknown_action"
),
false
return
""
,
MidjourneyErrorWrapper
(
constant
.
MjRequestError
,
"unknown_
relay_
action"
),
false
}
}
modelName
:=
CoverActionToModelName
(
action
)
...
...
@@ -93,6 +93,9 @@ func CoverPlusActionToNormalAction(midjRequest *dto.MidjourneyRequest) *dto.Midj
}
else
if
strings
.
Contains
(
action
,
"pan"
)
{
midjRequest
.
Action
=
constant
.
MjActionPan
midjRequest
.
Index
=
1
}
else
if
strings
.
Contains
(
action
,
"reroll"
)
{
midjRequest
.
Action
=
constant
.
MjActionReRoll
midjRequest
.
Index
=
1
}
else
if
action
==
"Outpaint"
||
action
==
"CustomZoom"
{
midjRequest
.
Action
=
constant
.
MjActionZoom
midjRequest
.
Index
=
1
...
...
@@ -100,7 +103,7 @@ func CoverPlusActionToNormalAction(midjRequest *dto.MidjourneyRequest) *dto.Midj
midjRequest
.
Action
=
constant
.
MjActionInPaintPre
midjRequest
.
Index
=
1
}
else
{
return
MidjourneyErrorWrapper
(
constant
.
MjRequestError
,
"unknown_action
"
)
return
MidjourneyErrorWrapper
(
constant
.
MjRequestError
,
"unknown_action
:"
+
customId
)
}
return
nil
}
...
...
web/src/pages/Channel/EditChannel.js
View file @
bc2b1112
...
...
@@ -110,7 +110,7 @@ const EditChannel = (props) => {
'mj_zoom'
,
'mj_shorten'
,
'mj_inpaint_pre'
,
'mj_inpaint
_pre
'
,
'mj_inpaint'
,
'mj_high_variation'
,
'mj_low_variation'
,
'mj_pan'
,
...
...
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