optimize jimeng AI task params build

This commit is contained in:
GeekMaster
2025-09-09 18:05:51 +08:00
parent 3d8c37cb38
commit 1ca58606da
8 changed files with 1084 additions and 48 deletions

View File

@@ -119,7 +119,7 @@ func (s *Service) CreateTask(userId uint, req *CreateTaskRequest) (*model.Jimeng
Type: req.Type, Type: req.Type,
ReqKey: req.ReqKey, ReqKey: req.ReqKey,
Prompt: req.Prompt, Prompt: req.Prompt,
TaskParams: string(paramsJson), Params: string(paramsJson),
Status: model.JMTaskStatusInQueue, Status: model.JMTaskStatusInQueue,
Power: req.Power, Power: req.Power,
CreatedAt: time.Now(), CreatedAt: time.Now(),
@@ -187,7 +187,7 @@ func (s *Service) ProcessTask(jobId uint) error {
func (s *Service) buildTaskRequest(job *model.JimengJob) (*SubmitTaskRequest, error) { func (s *Service) buildTaskRequest(job *model.JimengJob) (*SubmitTaskRequest, error) {
// 解析任务参数 // 解析任务参数
var params map[string]any var params map[string]any
if err := json.Unmarshal([]byte(job.TaskParams), &params); err != nil { if err := json.Unmarshal([]byte(job.Params), &params); err != nil {
return nil, fmt.Errorf("parse task params failed: %w", err) return nil, fmt.Errorf("parse task params failed: %w", err)
} }

View File

@@ -159,8 +159,16 @@ func (s *MigrationService) MigrateConfigContent() error {
// 数据表迁移 // 数据表迁移
func (s *MigrationService) TableMigration() { func (s *MigrationService) TableMigration() {
// v4.2.7 数据表迁移
if s.db.Migrator().HasColumn(&model.JimengJob{}, "task_params") {
s.db.Migrator().RenameColumn(&model.JimengJob{}, "task_params", "params")
}
// 新数据表 // 新数据表
if !s.db.Migrator().HasTable(&model.Moderation{}) {
s.db.AutoMigrate(&model.Moderation{}) s.db.AutoMigrate(&model.Moderation{})
}
// 订单字段整理 // 订单字段整理
if s.db.Migrator().HasColumn(&model.Order{}, "pay_type") { if s.db.Migrator().HasColumn(&model.Order{}, "pay_type") {

View File

@@ -12,7 +12,7 @@ type JimengJob struct {
Type JMTaskType `gorm:"column:type;type:varchar(50);not null;comment:任务类型" json:"type"` Type JMTaskType `gorm:"column:type;type:varchar(50);not null;comment:任务类型" json:"type"`
ReqKey string `gorm:"column:req_key;type:varchar(100);comment:请求Key" json:"req_key"` ReqKey string `gorm:"column:req_key;type:varchar(100);comment:请求Key" json:"req_key"`
Prompt string `gorm:"column:prompt;type:text;comment:提示词" json:"prompt"` Prompt string `gorm:"column:prompt;type:text;comment:提示词" json:"prompt"`
TaskParams string `gorm:"column:task_params;type:text;comment:任务参数JSON" json:"task_params"` Params string `gorm:"column:params;type:text;comment:任务参数JSON" json:"params"`
ImgURL string `gorm:"column:img_url;type:varchar(1024);comment:图片或封面URL" json:"img_url"` ImgURL string `gorm:"column:img_url;type:varchar(1024);comment:图片或封面URL" json:"img_url"`
VideoURL string `gorm:"column:video_url;type:varchar(1024);comment:视频URL" json:"video_url"` VideoURL string `gorm:"column:video_url;type:varchar(1024);comment:视频URL" json:"video_url"`
RawData string `gorm:"column:raw_data;type:text;comment:原始API响应" json:"raw_data"` RawData string `gorm:"column:raw_data;type:text;comment:原始API响应" json:"raw_data"`

View File

@@ -10,7 +10,7 @@ type JimengJob struct {
Type model.JMTaskType `json:"type"` Type model.JMTaskType `json:"type"`
ReqKey string `json:"req_key"` ReqKey string `json:"req_key"`
Prompt string `json:"prompt"` Prompt string `json:"prompt"`
TaskParams string `json:"task_params"` Params map[string]any `json:"params"`
ImgURL string `json:"img_url"` ImgURL string `json:"img_url"`
VideoURL string `json:"video_url"` VideoURL string `json:"video_url"`
RawData string `json:"raw_data"` RawData string `json:"raw_data"`

View File

@@ -78,7 +78,7 @@
:show-file-list="false" :show-file-list="false"
:http-request="handleUpload" :http-request="handleUpload"
:multiple="multiple" :multiple="multiple"
accept="image/*" :accept="accept"
class="uploader" class="uploader"
:limit="maxCount" :limit="maxCount"
> >
@@ -86,7 +86,7 @@
<div class="el-upload__text">拖拽图片到此处 <em>点击上传</em></div> <div class="el-upload__text">拖拽图片到此处 <em>点击上传</em></div>
<template #tip> <template #tip>
<div class="el-upload__tip text-gray-500 text-sm"> <div class="el-upload__tip text-gray-500 text-sm">
支持 JPGPNG 格式最多上传 {{ maxCount }} 单张最大 5MB 支持 {{ accept }} 格式最多上传 {{ maxCount }} 单张最大 {{ maxSize }}MB
</div> </div>
</template> </template>
</el-upload> </el-upload>
@@ -123,6 +123,14 @@ const props = defineProps({
type: Number, type: Number,
default: 1, default: 1,
}, },
maxSize: {
type: Number,
default: 5,
},
accept: {
type: String,
default: '.png,.jpg,.jpeg',
},
}) })
const emit = defineEmits(['update:modelValue', 'upload-success']) const emit = defineEmits(['update:modelValue', 'upload-success'])
@@ -161,8 +169,8 @@ const handleUpload = async (uploadFile) => {
} }
// 检查文件大小 (5MB) // 检查文件大小 (5MB)
if (file.size > 5 * 1024 * 1024) { if (file.size > props.maxSize * 1024 * 1024) {
ElMessage.error('图片大小不能超过 5MB') ElMessage.error(`图片大小不能超过 ${props.maxSize}MB`)
return return
} }

View File

@@ -0,0 +1,632 @@
export const paramsMap = {
image: [
{
name: '图片 2.1 文生图',
version: '2.1',
label: '平面绘感强,可生成文字海报',
key: 'jimeng_high_aes_general_v21_L',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成图像的提示词 ,中英文均可输入',
},
{
name: 'size',
type: 'select',
required: true,
placeholder: '请选择尺寸',
label: '图片尺寸',
options: [
{
label: '21:9 (1195 * 512)',
value: '1195x512',
},
{
label: '16:9 (1024 * 576)',
value: '1024x576',
},
{
label: '3:2 (1024 * 682)',
value: '1024x682',
},
{
label: '4:3 (1024 * 768)',
value: '1024x768',
},
{
label: '1:1 (1024 * 1024)',
value: '1024x1024',
},
{
label: '3:4 (768 * 1024)',
value: '768x1024',
},
{
label: '2:3 (682 * 1024)',
value: '682x1024',
},
{
label: '9:16 (576 * 1024)',
value: '576x1024',
},
],
},
{
name: 'use_pre_llm',
type: 'boolean',
required: true,
label: '开启文本扩写',
info: '开启后,系统会自动扩写提示词,提高生成质量',
value: true,
},
],
},
{
name: '图片 3.0 文生图',
version: '3.0',
label: '影视质感文字更准直出2k高清图',
key: 'jimeng_t2i_v30',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成图像的提示词 ,中英文均可输入',
},
{
name: 'size',
type: 'select',
required: true,
placeholder: '请选择尺寸',
label: '图片尺寸',
options: [
{
label: '1:1 (1328 * 1328)',
value: '1328x1328',
},
{
label: '4:3 (1472 * 1104)',
value: '1472x1104',
},
{
label: '3:2 (1584 * 1056)',
value: '1584x1056',
},
{
label: '16:9 (1664 * 936)',
value: '1664x936',
},
{
label: '21:9 (2016 * 864)',
value: '2016x864',
},
{
label: '1:1 高清2K (2048 * 2048)',
value: '2048x2048',
},
{
label: '4:3 高清2K (2304 * 1728)',
value: '2304x1728',
},
{
label: '3:2 高清2K (2496 * 1664)',
value: '2496x1664',
},
{
label: '16:9 高清2K (2560 * 1440)',
value: '2560x1440',
},
{
label: '21:9 高清2K (3024 * 1296)',
value: '3024x1296',
},
],
},
{
name: 'use_pre_llm',
type: 'boolean',
required: true,
label: '开启文本扩写',
info: '开启后,系统会自动扩写提示词,提高生成质量',
},
],
},
{
name: '图片 3.1 文生图',
version: '3.1',
label: '丰富的美学多样性,画面更鲜明生动',
key: 'jimeng_t2i_v31',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成图像的提示词 ,中英文均可输入',
},
{
name: 'size',
type: 'select',
required: true,
placeholder: '请选择尺寸',
label: '图片尺寸',
options: [
{
label: '1:1 (1328 * 1328)',
value: '1328x1328',
},
{
label: '4:3 (1472 * 1104)',
value: '1472x1104',
},
{
label: '3:2 (1584 * 1056)',
value: '1584x1056',
},
{
label: '16:9 (1664 * 936)',
value: '1664x936',
},
{
label: '21:9 (2016 * 864)',
value: '2016x864',
},
{
label: '1:1 高清2K (2048 * 2048)',
value: '2048x2048',
},
{
label: '4:3 高清2K (2304 * 1728)',
value: '2304x1728',
},
{
label: '3:2 高清2K (2496 * 1664)',
value: '2496x1664',
},
{
label: '16:9 高清2K (2560 * 1440)',
value: '2560x1440',
},
{
label: '21:9 高清2K (3024 * 1296)',
value: '3024x1296',
},
],
},
{
name: 'use_pre_llm',
type: 'boolean',
required: true,
label: '开启文本扩写',
info: '开启后,系统会自动扩写提示词,提高生成质量',
},
],
},
{
name: '图片 3.0 图生图',
version: '3.0',
label: '精准执行编辑指令,保持图像内容完整性',
key: 'jimeng_i2i_v30',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入用于编辑图像的提示词把xxx改成xxx删除xxx添加xxx等',
info: '建议长度<=120字符最长不超过800字符',
},
{
name: 'image_urls',
label: '参考图片',
type: 'image',
required: true,
placeholder: '请上传图片',
maxSize: 5,
accept: '.png,.jpg,.jpeg',
info: '长边与短边比例在3以内超出此比例或比例相对极端会导致报错。',
},
{
name: 'scale',
label: '文本描述影响的程度',
type: 'slider',
min: 0,
max: 1,
step: 0.1,
value: 0.5,
info: '该值越大代表文本描述影响程度越大,且输入图片影响程度越小',
},
{
name: 'size',
type: 'select',
required: true,
placeholder: '请选择尺寸',
label: '图片尺寸',
options: [
{
label: '11 (1328 * 1328)',
value: '1328x1328',
},
{
label: '43 (1472 * 1104)',
value: '1472x1104',
},
{
label: '32 (1584 * 1056)',
value: '1584x1056',
},
{
label: '169 (1664 * 936)',
value: '1664x936',
},
{
label: '219 (2016 * 864)',
value: '2016x864',
},
],
},
],
},
],
video: [
{
name: '视频 3.0 720P-文生视频',
version: '3.0',
label: '生成效果与速度兼备',
key: 'jimeng_t2v_v30',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成视频的提示词 ,中英文均可输入',
},
{
name: 'aspect_ratio',
label: '视频比例',
type: 'select',
required: false,
placeholder: '请选择视频比例',
options: [
{
label: '16:9 (横版)',
value: '16:9',
},
{
label: '4:3 (标准)',
value: '4:3',
},
{
label: '1:1 (正方形)',
value: '1:1',
},
{
label: '3:4 (竖版)',
value: '3:4',
},
{
label: '9:16 (竖屏)',
value: '9:16',
},
{
label: '21:9 (超宽)',
value: '21:9',
},
],
},
{
name: 'duration',
type: 'select',
label: '视频时长',
options: [
{
label: '5秒',
value: '5',
},
{
label: '10秒',
value: '10',
},
],
},
],
},
{
name: '视频 3.0 720P-图生视频-首帧',
version: '3.0',
label: '根据提示词 + 首帧图片生成视频',
key: 'jimeng_i2v_first_v30',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成视频的提示词 ,中英文均可输入',
},
{
name: 'image_urls',
label: '首帧图片',
type: 'image',
required: false,
placeholder: '请上传图片',
multiple: false,
maxCount: 1,
maxSize: 5,
accept: '.png,.jpg,.jpeg',
},
{
name: 'duration',
type: 'select',
label: '视频时长',
options: [
{
label: '5秒',
value: '5',
},
{
label: '10秒',
value: '10',
},
],
},
],
},
{
name: '视频 3.0 720P-图生视频-首尾帧',
version: '3.0',
label: '根据提示词 + 首尾帧图片生成视频',
key: 'jimeng_i2v_first_tail_v30',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成视频的提示词 ,中英文均可输入',
},
{
name: 'image_urls',
label: '首帧图片',
type: 'image',
required: false,
placeholder: '请上传图片',
multiple: true,
maxCount: 2,
maxSize: 5,
accept: '.png,.jpg,.jpeg',
},
{
name: 'duration',
type: 'select',
label: '视频时长',
options: [
{
label: '5秒',
value: '5',
},
{
label: '10秒',
value: '10',
},
],
},
],
},
{
name: '视频 3.0 720P-图生视频-运镜',
version: '3.0',
label: '根据提示词 + 运镜图片生成视频',
key: 'jimeng_i2v_recamera_v30',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成视频的提示词 ,中英文均可输入',
},
{
name: 'image_urls',
label: '运镜图片',
type: 'image',
required: false,
placeholder: '请上传图片',
maxSize: 5,
multiple: false,
maxCount: 1,
accept: '.png,.jpg,.jpeg',
},
{
name: 'template_id',
label: '运镜控制',
type: 'select',
required: false,
placeholder: '请选择运镜控制',
options: [
{
label: '希区柯克推进',
value: 'hitchcock_dolly_in',
},
{
label: '希区柯克拉远',
value: 'hitchcock_dolly_out',
},
{
label: '机械臂',
value: 'robo_arm',
},
{
label: '动感环绕',
value: 'dynamic_orbit',
},
{
label: '中心环绕',
value: 'central_orbit',
},
{
label: '起重机',
value: 'crane_push',
},
{
label: '超级拉远',
value: 'quick_pull_back',
},
{
label: '逆时针回旋',
value: 'counterclockwise_swivel',
},
{
label: '顺时针回旋',
value: 'clockwise_swivel',
},
{
label: '手持运镜',
value: 'handheld',
},
{
label: '快速推拉',
value: 'rapid_push_pull',
},
],
},
{
name: 'camera_strength',
label: '运镜强度',
type: 'select',
required: false,
placeholder: '请选择运镜强度',
options: [
{
label: '弱',
value: 'weak',
},
{
label: '中',
value: 'medium',
},
{
label: '强',
value: 'strong',
},
],
},
{
name: 'duration',
type: 'select',
label: '视频时长',
options: [
{
label: '5秒',
value: '5',
},
{
label: '10秒',
value: '10',
},
],
},
],
},
{
name: '视频 3.0Pro 图生视频',
version: '3.0',
label: '根据提示词 + 首帧图片生成视频',
key: 'jimeng_ti2v_v30_pro',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成视频的提示词 ,中英文均可输入',
},
{
name: 'image_urls',
label: '首帧图片',
type: 'image',
required: false,
placeholder: '请上传图片',
info: '只支持上传首帧图片',
multiple: false,
maxCount: 1,
maxSize: 5,
accept: '.png,.jpg,.jpeg',
},
// 比例
{
name: 'aspect_ratio',
label: '视频比例',
type: 'select',
required: false,
placeholder: '请选择视频比例',
info: '只在文生视频场景下生效,图生视频场景会根据输入图的长宽比自动适配',
options: [
{
label: '21:9 (2176 * 928)',
value: '21:9',
},
{
label: '16:9 (1920 * 1088)',
value: '16:9',
},
{
label: '4:3 (1664 * 1248)',
value: '4:3',
},
{
label: '1:1 (1440 * 1440)',
value: '1:1',
},
{
label: '3:4 (1248 * 1664)',
value: '3:4',
},
{
label: '9:16 (1088 * 1920)',
value: '9:16',
},
],
},
{
name: 'duration',
type: 'select',
label: '视频时长',
options: [
{
label: '5秒',
value: '5',
},
{
label: '10秒',
value: '10',
},
],
},
],
},
],
virtualHuman: [],
actionTransfer: [],
}

View File

@@ -44,6 +44,225 @@ export const useJimengStore = defineStore('jimeng', () => {
// 登录弹窗 // 登录弹窗
const shareStore = useSharedStore() const shareStore = useSharedStore()
const paramsMap = {
image: [
{
name: '图片 2.1',
version: '2.1',
label: '平面绘感强,可生成文字海报',
key: 'jimeng_high_aes_general_v21_L',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成图像的提示词 ,中英文均可输入',
},
{
name: 'size',
type: 'select',
required: true,
placeholder: '请选择尺寸',
label: '图片尺寸',
options: [
{
label: '21:9 (1195x512)',
value: '1195x512',
},
{
label: '16:9 (1024x576)',
value: '1024x576',
},
{
label: '3:2 (1024x682)',
value: '1024x682',
},
{
label: '4:3 (1024x768)',
value: '1024x768',
},
{
label: '1:1 (1024x1024)',
value: '1024x1024',
},
{
label: '3:4 (768x1024)',
value: '768x1024',
},
{
label: '2:3 (682x1024)',
value: '682x1024',
},
{
label: '9:16 (576x1024)',
value: '576x1024',
},
],
},
{
name: 'use_pre_llm',
type: 'boolean',
required: true,
label: '开启文本扩写',
info: '开启后,系统会自动扩写提示词,提高生成质量',
value: true,
},
],
},
{
name: '图片 3.0 文生图',
version: '3.0',
label: '影视质感文字更准直出2k高清图',
key: 'jimeng_t2i_v30',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成图像的提示词 ,中英文均可输入',
},
{
name: 'size',
type: 'select',
required: true,
placeholder: '请选择尺寸',
label: '图片尺寸',
options: [
{
label: '1:1 (1328x1328)',
value: '1328x1328',
},
{
label: '4:3 (1472x1104)',
value: '1472x1104',
},
{
label: '3:2 (1584x1056)',
value: '1584x1056',
},
{
label: '16:9 (1664x936)',
value: '1664x936',
},
{
label: '21:9 (2016x864)',
value: '2016x864',
},
{
label: '1:1 高清2K (2048x2048)',
value: '2048x2048',
},
{
label: '4:3 高清2K (2304x1728)',
value: '2304x1728',
},
{
label: '3:2 高清2K (2496x1664)',
value: '2496x1664',
},
{
label: '16:9 高清2K (2560x1440)',
value: '2560x1440',
},
{
label: '21:9 高清2K (3024x1296)',
value: '3024x1296',
},
],
},
{
name: 'use_pre_llm',
type: 'boolean',
required: true,
label: '开启文本扩写',
info: '开启后,系统会自动扩写提示词,提高生成质量',
},
],
},
{
name: '图片 3.1',
version: '3.1',
label: '文生图3.0',
key: 'jimeng_t2i_v31',
params: [
{
name: 'prompt',
label: '提示词',
type: 'text',
required: true,
placeholder: '请输入提示词',
info: '用于生成图像的提示词 ,中英文均可输入',
},
{
name: 'size',
type: 'select',
required: true,
placeholder: '请选择尺寸',
label: '图片尺寸',
options: [
{
label: '1:1 (1328x1328)',
value: '1328x1328',
},
{
label: '4:3 (1472x1104)',
value: '1472x1104',
},
{
label: '3:2 (1584x1056)',
value: '1584x1056',
},
{
label: '16:9 (1664x936)',
value: '1664x936',
},
{
label: '21:9 (2016x864)',
value: '2016x864',
},
{
label: '1:1 高清2K (2048x2048)',
value: '2048x2048',
},
{
label: '4:3 高清2K (2304x1728)',
value: '2304x1728',
},
{
label: '3:2 高清2K (2496x1664)',
value: '2496x1664',
},
{
label: '16:9 高清2K (2560x1440)',
value: '2560x1440',
},
{
label: '21:9 高清2K (3024x1296)',
value: '3024x1296',
},
],
},
{
name: 'use_pre_llm',
type: 'boolean',
required: true,
label: '开启文本扩写',
info: '开启后,系统会自动扩写提示词,提高生成质量',
},
],
},
],
video: [],
virtualHuman: [],
actionTransfer: [],
}
// 功能分类配置 // 功能分类配置
const categories = [ const categories = [
{ key: 'image_generation', name: '图片生成' }, { key: 'image_generation', name: '图片生成' },

View File

@@ -19,6 +19,125 @@
</div> </div>
</div> </div>
<!-- 提示词编写指南可折叠 -->
<div class="prompt-guide">
<el-collapse v-model="guideActive">
<el-collapse-item name="guide">
<template #title>
<div class="guide-title">
<i class="iconfont icon-info mr-1"></i>
Prompt建议
</div>
</template>
<div class="guide-content">
<!-- 创建图像 -->
<div class="guide-section">
<div class="guide-subtitle">创建图像文生图</div>
<ul>
<li>
结构建议<strong>主体描述 + 风格 + 美学</strong>准确响应<strong
>风格 + 主体描述 + 美学 + 氛围</strong
>更强美学
</li>
<li>
用专业短词描述风格/镜头/构图主体用自然语言完整描述主体 + 行为 + 环境
</li>
<li>关键信息靠前用正向表达代替不要xxx类否定词</li>
<li>需要生成文字时明确生成文字并补充位置/风格/材质</li>
</ul>
<blockquote class="quote">
<div>
<strong>示例</strong
>新年主题海报上方以手写涂鸦风格写着新年快乐红金配色纸张纹理强对比光影居中极简构图留白用于标题
</div>
</blockquote>
<blockquote class="quote">
<div><strong>Before</strong>海报新年快乐</div>
<div><strong>After</strong>一张海报上面文字写着新年快乐</div>
</blockquote>
<blockquote class="quote">
<div><strong>Before</strong>海报新年快乐</div>
<div>
<strong>After</strong>一张海报画面上方有手写涂鸦风格的文字写着新年快乐
</div>
</blockquote>
<p>特征与视角可反复强调</p>
<ul>
<li>御剑飞行 男人站在剑上他踩在剑上剑被他踩着御剑飞仙</li>
<li>仰视视角 采用低角度从下往上仰视与广角构图</li>
</ul>
<blockquote class="quote">
<div>
<strong>示例</strong
>百合南瓜羹特写只展示半碗米黄色糯米勾芡橙色南瓜块与丝理清晰点缀紫白色百合
</div>
</blockquote>
</div>
<!-- 编辑图像 -->
<div class="guide-section">
<div class="guide-subtitle">编辑图像图生图/图像编辑</div>
<ul>
<li>应用场景可加海报平面设计等词以增强对应风格</li>
<li>生成或保留的文字请用引号包裹准确率更高</li>
<li>建议长度 120 最多不超过 800 过长可能失效</li>
<li>编辑指令用自然语言一次只做一件事更易生效</li>
<li>多实体时指明对谁做什么局部编辑尽量精准</li>
<li>效果不明显可提高编辑强度 scale底图越清晰效果越好</li>
</ul>
<blockquote class="quote">
<div><strong>示例添加/删除实体</strong>删除图上的女孩添加一道彩虹</div>
</blockquote>
<blockquote class="quote">
<div>
<strong>示例添加文字</strong>一张圣诞节海报上面写着Merry Christmas
</div>
</blockquote>
<blockquote class="quote">
<div><strong>示例修改实体</strong>把手里的鸡腿改成汉堡</div>
</blockquote>
<blockquote class="quote">
<div>
<strong>示例修改风格/色彩/动作/背景</strong
>改成漫画风格把外套改成粉色让男孩微笑背景换成海边日落
</div>
</blockquote>
</div>
<!-- 生成视频 -->
<div class="guide-section">
<div class="guide-subtitle">生成视频/图生视频</div>
<ul>
<li><strong>基础结构</strong>主体 / 背景 / 镜头 + 动作</li>
<li>
<strong>多个镜头连贯叙事</strong>镜头1 + 主体 + 动作1 + 镜头2 + 主体 + 动作2
...
</li>
<li>
<strong>多个连续动作</strong>时序主体1 + 运动1 + 运动2多主体主体1 +
运动1 + 主体2 + 运动2 ...
</li>
<li>
<strong>运镜词典</strong
>镜头切换镜头向上///右移动镜头拉近/拉远镜头环绕/航拍/广角/360度旋转镜头跟随固定镜头镜头特写手持拍摄晃动/抖动
</li>
<li>
<strong>程度副词</strong
>快速缓缓大幅度高频率剧烈等突出动作强度与节奏
</li>
</ul>
<blockquote class="quote">
<div>
<strong>示例</strong
>镜头1城市夜景航拍镜头环绕镜头2男主在屋顶奔跑镜头跟随快速镜头3男主停下特写霓虹反光缓慢拉近
</div>
</blockquote>
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
<!-- 功能开关 --> <!-- 功能开关 -->
<div <div
class="function-switch" class="function-switch"
@@ -581,6 +700,9 @@ const waterfallRendered = ref(false)
// 新增:模板预览图 // 新增:模板预览图
const templatePreview = ref('') const templatePreview = ref('')
// 新增:提示词指南折叠面板状态(默认收起)
const guideActive = ref([])
onMounted(() => { onMounted(() => {
store.init() store.init()
}) })
@@ -732,6 +854,7 @@ function copyErrorMsg(msg) {
.err-msg-clip { .err-msg-clip {
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -745,4 +868,50 @@ function copyErrorMsg(msg) {
line-height: 60px; line-height: 60px;
} }
} }
// 新增:提示词指南样式
.prompt-guide {
margin: 12px 0 16px;
.guide-title {
display: flex;
align-items: center;
font-weight: 600;
color: #666;
}
.guide-content {
max-height: 220px;
overflow: auto;
line-height: 1.6;
font-size: 12px;
color: #555;
padding-right: 4px;
}
.guide-section {
margin-bottom: 10px;
}
.guide-subtitle {
font-weight: 600;
margin-bottom: 6px;
color: #333;
}
ul {
list-style: disc;
padding-left: 18px;
margin: 4px 0;
}
.quote {
margin: 8px 0;
padding: 8px 10px;
border-left: 3px solid #a3a3a3;
background: #f8f8f8;
border-radius: 4px;
color: #444;
}
}
</style> </style>