Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
text2video-frontend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周成波
text2video-frontend
Commits
2aaad0d2
Commit
2aaad0d2
authored
Apr 20, 2024
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品图抠图和重绘,先提交一次
parent
53a74aa9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
437 additions
and
82 deletions
+437
-82
text2videoService.ts
src/api/service/text2videoService.ts
+71
-51
index.vue
src/views/home/index.vue
+361
-31
lib.wm.api.d.ts
typings/types/wm/lib.wm.api.d.ts
+5
-0
No files found.
src/api/service/text2videoService.ts
View file @
2aaad0d2
...
...
@@ -73,57 +73,6 @@ export default {
});
},
submitSDInPaint
(
task_id
:
string
=
""
,
img_idx
:
string
=
""
,
prompt
:
string
=
""
,
negative_prompt
:
string
=
""
,
width
:
string
=
""
,
height
:
string
=
""
,
sampler_index
:
string
=
""
,
seed
:
string
=
""
,
steps
:
string
=
""
,
cfg_scale
:
string
=
""
,
encrypt
:
string
=
"false"
,
model
:
string
=
""
,
base_img
:
string
=
""
,
mask
:
string
=
""
):
Promise
<
{
"domain_image_path"
:
string
,
"local_image_path"
:
string
}
>
{
if
(
!
prompt
||
!
base_img
||
!
mask
)
{
return
Promise
.
reject
(
"SD提示词、基础图、mask均不能为空"
);
}
const
post_data
=
{
task_id
:
task_id
,
img_idx
:
img_idx
,
prompt
:
prompt
,
negative_prompt
:
negative_prompt
,
sampler_index
:
sampler_index
,
seed
:
seed
,
steps
:
steps
,
width
:
width
,
height
:
height
,
cfg_scale
:
cfg_scale
,
encrypt
:
encrypt
,
model
:
model
,
base_img
:
base_img
,
mask
:
mask
}
return
request
.
post
(
'/text2video/img2img_inpaint'
,
post_data
)
.
then
((
res
:
any
)
=>
{
// console.log(res);
if
(
res
&&
res
.
code
===
0
)
{
return
{
"domain_image_path"
:
res
.
data
.
result
.
domain_image_path
,
"local_image_path"
:
res
.
data
.
result
.
local_image_path
};
}
else
{
const
errorMessage
=
res
?
res
.
message
:
"未知错误"
;
return
Promise
.
reject
(
errorMessage
);
}
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与 stable-diffusion-webui Api 通讯失败`
);
});
},
submitGenVideo
(
gen_video_param
:
any
):
Promise
<
string
>
{
if
(
!
gen_video_param
)
{
return
Promise
.
reject
(
"输入不能为空"
);
...
...
@@ -258,4 +207,75 @@ export default {
return
Promise
.
reject
(
`与ImgTextMatch Api通讯失败`
);
});
},
submitCutOutImg
(
param
:
any
):
Promise
<
any
>
{
const
post_data
=
param
;
return
request
.
post
(
'/text2video/cutout_from_img'
,
post_data
)
.
then
((
res
:
any
)
=>
{
// console.log(res);
if
(
res
&&
res
.
code
===
0
)
{
return
res
.
data
.
result
;
}
else
{
const
errorMessage
=
res
?
res
.
message
:
"未知错误"
;
return
Promise
.
reject
(
errorMessage
);
}
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与 cutout_from_img Api 通讯失败`
);
});
},
submitSDInPaint
(
task_id
:
string
=
""
,
img_idx
:
string
=
""
,
prompt
:
string
=
""
,
negative_prompt
:
string
=
""
,
width
:
string
=
""
,
height
:
string
=
""
,
sampler_index
:
string
=
""
,
seed
:
string
=
""
,
steps
:
string
=
""
,
cfg_scale
:
string
=
""
,
encrypt
:
string
=
"false"
,
model
:
string
=
""
,
base_img
:
string
=
""
,
mask
:
string
=
""
,
img_data_type
:
string
=
""
):
Promise
<
{
"domain_image_path"
:
string
,
"local_image_path"
:
string
}
>
{
if
(
!
prompt
||
!
base_img
||
!
mask
)
{
return
Promise
.
reject
(
"SD提示词、基础图、mask均不能为空"
);
}
const
post_data
=
{
task_id
:
task_id
,
img_idx
:
img_idx
,
prompt
:
prompt
,
negative_prompt
:
negative_prompt
,
sampler_index
:
sampler_index
,
seed
:
seed
,
steps
:
steps
,
width
:
width
,
height
:
height
,
cfg_scale
:
cfg_scale
,
encrypt
:
encrypt
,
model
:
model
,
base_img
:
base_img
,
mask
:
mask
,
img_data_type
:
img_data_type
}
return
request
.
post
(
'/text2video/img2img_inpaint'
,
post_data
)
.
then
((
res
:
any
)
=>
{
// console.log(res);
if
(
res
&&
res
.
code
===
0
)
{
return
{
"domain_image_path"
:
res
.
data
.
result
.
domain_image_path
,
"local_image_path"
:
res
.
data
.
result
.
local_image_path
};
}
else
{
const
errorMessage
=
res
?
res
.
message
:
"未知错误"
;
return
Promise
.
reject
(
errorMessage
);
}
})
.
catch
((
err
:
any
)
=>
{
console
.
log
(
`err =
${
JSON
.
stringify
(
err
)}
`
);
return
Promise
.
reject
(
`与 img2img_inpaint Api 通讯失败`
);
});
},
}
src/views/home/index.vue
View file @
2aaad0d2
This diff is collapsed.
Click to expand it.
typings/types/wm/lib.wm.api.d.ts
View file @
2aaad0d2
...
...
@@ -63,4 +63,9 @@ declare namespace Wm {
],
"message"
:
string
}
interface
Coordinate
{
"x"
:
int
,
"y"
:
int
,
}
}
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