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