Toggle navigation
Toggle navigation
This project
Loading...
Sign in
卢阳
/
front_backend_zImage
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
ly0303521
2026-01-12 16:50:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cebb237b1edf035e22bd7cd7e268481eb758490b
cebb237b
1 parent
7592da80
修改视频的参数显示
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
backend/main.py
z-image-generator/App.tsx
z-image-generator/components/DetailModal.tsx
z-image-generator/services/videoService.ts
backend/main.py
View file @
cebb237
...
...
@@ -58,6 +58,7 @@ class GalleryImage(GalleryItem):
class
GalleryVideo
(
GalleryItem
):
generation_time
:
Optional
[
float
]
=
Field
(
default
=
None
,
alias
=
"generationTime"
)
seed
:
Optional
[
int
]
=
Field
(
default
=
None
,
ge
=
0
)
class
ImageGenerationResponse
(
BaseModel
):
image
:
Optional
[
str
]
=
None
...
...
z-image-generator/App.tsx
View file @
cebb237
...
...
@@ -114,7 +114,7 @@ const App: React.FC = () => {
setVideoStatus({ status: 'submitting', message: '提交中...', task_id: 'temp' });
try {
const taskId = await submitVideoJob(params.prompt, imageFile, currentUser.employeeId);
const taskId = await submitVideoJob(params.prompt, imageFile, currentUser.employeeId
, params.seed
);
const finalStatus = await pollVideoStatus(taskId, setVideoStatus);
if (!finalStatus.video_filename) {
...
...
z-image-generator/components/DetailModal.tsx
View file @
cebb237
...
...
@@ -91,18 +91,16 @@ const DetailModal: React.FC<DetailModalProps> = ({ image, onClose, onEdit, onGen
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-xs font-semibold text-gray-400 uppercase mb-1">分辨率</label>
<p className="text-gray-800 dark:text-gray-200 font-mono">
{image.width || (isVideo ? 1280 : 'N/A')} x {image.height || (isVideo ? 720 : 'N/A')}
</p>
</div>
<div>
<label className="block text-xs font-semibold text-gray-400 uppercase mb-1">随机种子</label>
<p className="text-gray-800 dark:text-gray-200 font-mono">{image.seed !== undefined ? image.seed : 'N/A'}</p>
</div>
{!isVideo && (
<>
<div>
<label className="block text-xs font-semibold text-gray-400 uppercase mb-1">分辨率</label>
<p className="text-gray-800 dark:text-gray-200 font-mono">{image.width} x {image.height}</p>
</div>
<div>
<label className="block text-xs font-semibold text-gray-400 uppercase mb-1">生成步数</label>
<p className="text-gray-800 dark:text-gray-200 font-mono">{image.num_inference_steps || 'N/A'}</p>
</div>
...
...
z-image-generator/services/videoService.ts
View file @
cebb237
...
...
@@ -5,11 +5,12 @@ import { VideoStatus } from '../types';
* Submits a video generation job to the backend.
* @returns The task ID for the submitted job.
*/
export
const
submitVideoJob
=
async
(
prompt
:
string
,
image
:
File
,
authorId
:
string
)
:
Promise
<
string
>
=>
{
export
const
submitVideoJob
=
async
(
prompt
:
string
,
image
:
File
,
authorId
:
string
,
seed
:
number
)
:
Promise
<
string
>
=>
{
const
formData
=
new
FormData
();
formData
.
append
(
'prompt'
,
prompt
);
formData
.
append
(
'image'
,
image
,
image
.
name
);
formData
.
append
(
'author_id'
,
authorId
);
formData
.
append
(
'seed'
,
seed
.
toString
());
const
submitRes
=
await
fetch
(
`
$
{
TURBO_DIFFUSION_API_URL
}
/submit-job/
`
,
{
method
:
'POST'
,
...
...
Please
register
or
login
to post a comment