Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaoai-video
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
姚珂
yaoai-video
Commits
3b6236dd
Commit
3b6236dd
authored
Apr 23, 2026
by
yaoke.yk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update comic studio project and asset generation flow
parent
16da3a9f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
69 additions
and
19 deletions
+69
-19
vite.config.ts
doc/html/vite.config.ts
+5
-0
docker-compose.yml
yaoai-comic-studio/docker-compose.yml
+0
-2
CharacterController.java
...in/java/com/yaoai/api/controller/CharacterController.java
+12
-7
ProjectCreateRequest.java
.../java/com/yaoai/api/dto/project/ProjectCreateRequest.java
+6
-0
ProjectDTO.java
...i/src/main/java/com/yaoai/api/dto/project/ProjectDTO.java
+4
-0
ProjectUpdateRequest.java
.../java/com/yaoai/api/dto/project/ProjectUpdateRequest.java
+4
-0
ProjectServiceImpl.java
...n/java/com/yaoai/api/service/impl/ProjectServiceImpl.java
+5
-0
YaoAiApplication.java
...i-bootstrap/src/main/java/com/yaoai/YaoAiApplication.java
+1
-0
V11__character_three_views.sql
...ain/resources/db/migration/V11__character_three_views.sql
+13
-0
V12__project_display_options.sql
...n/resources/db/migration/V12__project_display_options.sql
+3
-0
Character.java
...main/src/main/java/com/yaoai/domain/entity/Character.java
+9
-3
Project.java
...domain/src/main/java/com/yaoai/domain/entity/Project.java
+4
-0
AssetGenPipelineService.java
...a/com/yaoai/pipeline/service/AssetGenPipelineService.java
+3
-7
AssetGenPipelineServiceImpl.java
...ai/pipeline/service/impl/AssetGenPipelineServiceImpl.java
+0
-0
No files found.
doc/html/vite.config.ts
View file @
3b6236dd
...
...
@@ -30,6 +30,11 @@ export default defineConfig({
'@'
:
path
.
resolve
(
__dirname
,
'./src'
),
},
},
server
:
{
host
:
true
,
port
:
5173
,
allowedHosts
:
true
},
// File types to support raw imports. Never add .css, .tsx, or .ts files to this.
assetsInclude
:
[
'**/*.svg'
,
'**/*.csv'
],
...
...
yaoai-comic-studio/docker-compose.yml
View file @
3b6236dd
version
:
"
3.9"
services
:
mysql
:
image
:
mysql:8.0
...
...
yaoai-comic-studio/yaoai-api/src/main/java/com/yaoai/api/controller/CharacterController.java
View file @
3b6236dd
...
...
@@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.util.List
;
@Tag
(
name
=
"角色管理"
)
...
...
@@ -22,7 +21,7 @@ public class CharacterController {
private
final
AssetGenPipelineService
assetService
;
@Operation
(
summary
=
"AI 提取角色列表
(从大纲+分集)
"
)
@Operation
(
summary
=
"AI 提取角色列表"
)
@PostMapping
(
"/extract"
)
public
ApiResponse
<
List
<
Character
>>
extract
(
@PathVariable
Long
projectId
)
{
return
ApiResponse
.
success
(
assetService
.
extractCharacters
(
projectId
,
TenantContext
.
get
()));
...
...
@@ -34,7 +33,7 @@ public class CharacterController {
return
ApiResponse
.
success
(
assetService
.
listCharacters
(
projectId
,
TenantContext
.
get
()));
}
@Operation
(
summary
=
"新建
/
更新角色"
)
@Operation
(
summary
=
"新建
或
更新角色"
)
@PostMapping
public
ApiResponse
<
Character
>
save
(
@PathVariable
Long
projectId
,
@RequestBody
Character
req
)
{
req
.
setProjectId
(
projectId
);
...
...
@@ -42,23 +41,29 @@ public class CharacterController {
return
ApiResponse
.
success
(
assetService
.
saveCharacter
(
req
));
}
@Operation
(
summary
=
"
为角色生成形象图(Seedream)
"
)
@Operation
(
summary
=
"
AI 生成角色三视图
"
)
@PostMapping
(
"/{characterId}/generate-image"
)
public
ApiResponse
<
Character
>
generateImage
(
@PathVariable
Long
projectId
,
@PathVariable
Long
characterId
)
{
return
ApiResponse
.
success
(
assetService
.
generateCharacterImage
(
characterId
,
TenantContext
.
get
()));
}
@Operation
(
summary
=
"上传角色
图片(手动)
"
)
@Operation
(
summary
=
"上传角色
视图图片
"
)
@PostMapping
(
value
=
"/{characterId}/upload-image"
,
consumes
=
"multipart/form-data"
)
public
ApiResponse
<
Character
>
uploadImage
(
@PathVariable
Long
projectId
,
@PathVariable
Long
characterId
,
@RequestParam
(
defaultValue
=
"front"
)
String
viewType
,
@RequestPart
(
"file"
)
MultipartFile
file
)
throws
IOException
{
String
originalName
=
file
.
getOriginalFilename
()
!=
null
?
file
.
getOriginalFilename
()
:
"image.jpg"
;
String
ext
=
originalName
.
contains
(
"."
)
?
originalName
.
substring
(
originalName
.
lastIndexOf
(
'.'
)
+
1
)
:
"jpg"
;
return
ApiResponse
.
success
(
assetService
.
uploadCharacterImage
(
characterId
,
TenantContext
.
get
(),
file
.
getInputStream
(),
file
.
getSize
(),
file
.
getContentType
(),
ext
));
characterId
,
TenantContext
.
get
(),
viewType
,
file
.
getInputStream
(),
file
.
getSize
(),
file
.
getContentType
(),
ext
));
}
@Operation
(
summary
=
"删除角色"
)
...
...
yaoai-comic-studio/yaoai-api/src/main/java/com/yaoai/api/dto/project/ProjectCreateRequest.java
View file @
3b6236dd
...
...
@@ -13,4 +13,10 @@ public class ProjectCreateRequest {
@Size
(
max
=
2000
,
message
=
"描述最长 2000 字符"
)
private
String
description
;
private
String
style
;
private
String
aspectRatio
;
private
String
resolution
;
}
yaoai-comic-studio/yaoai-api/src/main/java/com/yaoai/api/dto/project/ProjectDTO.java
View file @
3b6236dd
...
...
@@ -13,6 +13,8 @@ public class ProjectDTO {
private
String
description
;
private
String
status
;
private
String
style
;
private
String
aspectRatio
;
private
String
resolution
;
private
String
coverUrl
;
private
long
assetCount
;
private
LocalDateTime
createdAt
;
...
...
@@ -25,6 +27,8 @@ public class ProjectDTO {
dto
.
setDescription
(
p
.
getDescription
());
dto
.
setStatus
(
p
.
getStatus
());
dto
.
setStyle
(
p
.
getStyle
());
dto
.
setAspectRatio
(
p
.
getAspectRatio
());
dto
.
setResolution
(
p
.
getResolution
());
dto
.
setCoverUrl
(
coverUrl
);
dto
.
setAssetCount
(
assetCount
);
dto
.
setCreatedAt
(
p
.
getCreatedAt
());
...
...
yaoai-comic-studio/yaoai-api/src/main/java/com/yaoai/api/dto/project/ProjectUpdateRequest.java
View file @
3b6236dd
...
...
@@ -13,4 +13,8 @@ public class ProjectUpdateRequest {
private
String
description
;
private
String
style
;
private
String
aspectRatio
;
private
String
resolution
;
}
yaoai-comic-studio/yaoai-api/src/main/java/com/yaoai/api/service/impl/ProjectServiceImpl.java
View file @
3b6236dd
...
...
@@ -40,6 +40,9 @@ public class ProjectServiceImpl implements ProjectService {
project
.
setName
(
req
.
getName
());
project
.
setDescription
(
req
.
getDescription
());
project
.
setStatus
(
"draft"
);
project
.
setStyle
(
req
.
getStyle
());
project
.
setAspectRatio
(
req
.
getAspectRatio
());
project
.
setResolution
(
req
.
getResolution
());
projectMapper
.
insert
(
project
);
return
toDTO
(
project
);
...
...
@@ -75,6 +78,8 @@ public class ProjectServiceImpl implements ProjectService {
if
(
req
.
getName
()
!=
null
)
project
.
setName
(
req
.
getName
());
if
(
req
.
getDescription
()
!=
null
)
project
.
setDescription
(
req
.
getDescription
());
if
(
req
.
getStyle
()
!=
null
)
project
.
setStyle
(
req
.
getStyle
());
if
(
req
.
getAspectRatio
()
!=
null
)
project
.
setAspectRatio
(
req
.
getAspectRatio
());
if
(
req
.
getResolution
()
!=
null
)
project
.
setResolution
(
req
.
getResolution
());
projectMapper
.
updateById
(
project
);
return
toDTO
(
project
);
...
...
yaoai-comic-studio/yaoai-bootstrap/src/main/java/com/yaoai/YaoAiApplication.java
View file @
3b6236dd
...
...
@@ -12,4 +12,5 @@ public class YaoAiApplication {
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
YaoAiApplication
.
class
,
args
);
}
}
yaoai-comic-studio/yaoai-bootstrap/src/main/resources/db/migration/V11__character_three_views.sql
0 → 100644
View file @
3b6236dd
ALTER
TABLE
characters
ADD
COLUMN
front_image_url
VARCHAR
(
1024
)
NULL
AFTER
image_url
,
ADD
COLUMN
front_image_tos_key
VARCHAR
(
512
)
NULL
AFTER
image_tos_key
,
ADD
COLUMN
side_image_url
VARCHAR
(
1024
)
NULL
AFTER
front_image_url
,
ADD
COLUMN
side_image_tos_key
VARCHAR
(
512
)
NULL
AFTER
front_image_tos_key
,
ADD
COLUMN
back_image_url
VARCHAR
(
1024
)
NULL
AFTER
side_image_url
,
ADD
COLUMN
back_image_tos_key
VARCHAR
(
512
)
NULL
AFTER
side_image_tos_key
;
UPDATE
characters
SET
front_image_url
=
image_url
,
front_image_tos_key
=
image_tos_key
WHERE
image_url
IS
NOT
NULL
AND
(
front_image_url
IS
NULL
OR
front_image_url
=
''
);
yaoai-comic-studio/yaoai-bootstrap/src/main/resources/db/migration/V12__project_display_options.sql
0 → 100644
View file @
3b6236dd
ALTER
TABLE
projects
ADD
COLUMN
aspect_ratio
VARCHAR
(
20
)
DEFAULT
NULL
COMMENT
'画幅比例'
AFTER
style
,
ADD
COLUMN
resolution
VARCHAR
(
20
)
DEFAULT
NULL
COMMENT
'清晰度'
AFTER
aspect_ratio
;
yaoai-comic-studio/yaoai-domain/src/main/java/com/yaoai/domain/entity/Character.java
View file @
3b6236dd
...
...
@@ -28,13 +28,19 @@ public class Character {
private
String
costume
;
private
String
visualHint
;
/**
供 Seedream 文生图使用的英文 Prompt
*/
/**
Base prompt for standardized character image generation.
*/
private
String
imagePrompt
;
/**
Seedream 生成的临时 URL(仅展示)
*/
/**
Keep the primary image for backward compatibility; this points to the front view.
*/
private
String
imageUrl
;
/** 已存入 TOS 的 key */
private
String
imageTosKey
;
private
String
frontImageUrl
;
private
String
frontImageTosKey
;
private
String
sideImageUrl
;
private
String
sideImageTosKey
;
private
String
backImageUrl
;
private
String
backImageTosKey
;
/** draft / generating / ready / failed */
private
String
status
;
...
...
yaoai-comic-studio/yaoai-domain/src/main/java/com/yaoai/domain/entity/Project.java
View file @
3b6236dd
...
...
@@ -27,6 +27,10 @@ public class Project {
private
String
style
;
private
String
aspectRatio
;
private
String
resolution
;
private
String
coverKey
;
private
LocalDateTime
createdAt
;
...
...
yaoai-comic-studio/yaoai-pipeline/src/main/java/com/yaoai/pipeline/service/AssetGenPipelineService.java
View file @
3b6236dd
...
...
@@ -8,16 +8,13 @@ import java.util.List;
public
interface
AssetGenPipelineService
{
/** 根据大纲 + 分集内容,AI 提取角色列表并保存(不含生图) */
List
<
Character
>
extractCharacters
(
Long
projectId
,
Long
tenantId
);
/** 根据大纲 + 分集内容,AI 提取场景列表并保存(不含生图) */
List
<
Scene
>
extractScenes
(
Long
projectId
,
Long
tenantId
);
/**
为指定角色调用 Seedream 生图并存 TOS
*/
/**
Generate three standardized character turnaround views: front, side, and back.
*/
Character
generateCharacterImage
(
Long
characterId
,
Long
tenantId
);
/** 为指定场景调用 Seedream 生图并存 TOS */
Scene
generateSceneImage
(
Long
sceneId
,
Long
tenantId
);
List
<
Character
>
listCharacters
(
Long
projectId
,
Long
tenantId
);
...
...
@@ -32,9 +29,8 @@ public interface AssetGenPipelineService {
void
deleteScene
(
Long
id
,
Long
tenantId
);
/** 上传用户自定义角色图,存 TOS 并更新 imageUrl */
Character
uploadCharacterImage
(
Long
characterId
,
Long
tenantId
,
InputStream
stream
,
long
size
,
String
contentType
,
String
ext
);
Character
uploadCharacterImage
(
Long
characterId
,
Long
tenantId
,
String
viewType
,
InputStream
stream
,
long
size
,
String
contentType
,
String
ext
);
/** 上传用户自定义场景图,存 TOS 并更新 imageUrl */
Scene
uploadSceneImage
(
Long
sceneId
,
Long
tenantId
,
InputStream
stream
,
long
size
,
String
contentType
,
String
ext
);
}
yaoai-comic-studio/yaoai-pipeline/src/main/java/com/yaoai/pipeline/service/impl/AssetGenPipelineServiceImpl.java
View file @
3b6236dd
This diff is collapsed.
Click to expand it.
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