Skip to content

[feat] Job Runner UI#1148

Open
dsynkd wants to merge 59 commits intohao-ai-lab:mainfrom
dsynkd:job_runner_ui
Open

[feat] Job Runner UI#1148
dsynkd wants to merge 59 commits intohao-ai-lab:mainfrom
dsynkd:job_runner_ui

Conversation

@dsynkd
Copy link
Contributor

@dsynkd dsynkd commented Mar 1, 2026

This PR adds a web-based UI that allows running jobs for various purposes. Currently only video inference is supported with the following parameters:

  • Inference Steps
  • Frames
  • Height
  • Width
  • Guidance Scale
  • Seed
  • GPUs
  • DiT CPU Offload
  • Text Encoder CPU Offload
  • FSDP Inference

Jobs can be:

  • Created
  • Started
  • Stopped
  • Restarted
  • Deleted

All models that are registered through FastVideo registry are supported.

Currently the following features are included:

  • Console Log
  • Download Log
  • Inference Timer

To run, navigate to the ui directory and run:

npm i
npm run build
npm start

There are two services that start concurrently: the web server and the API server. They can also be started separately using npm run start:api and npm run start:web. In this case, the .env.local file can be used to configure the API server URL (it defaults to http://localhost:8089).

The web server can also be run in dev mode using npm run dev. This will automatically restart the server upon any changes made to the UI.

Demo video is shown below:

Screen.Recording.2026-02-28.at.1.31.12.PM.480p.mov

…e it was checking for `UV` environment variable instead of the `uv` executable
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a significant new feature: a web-based interface for FastVideo, enabling users to interactively manage video generation tasks. It provides a user-friendly way to initiate and oversee video inference, offering real-time feedback and control over job execution and parameters. The introduction of this UI streamlines the workflow for generating videos, making the powerful FastVideo library more accessible and manageable for a wider range of users.

Highlights

  • New Web-based UI for Job Management: Introduced a comprehensive web-based user interface for creating, managing, and monitoring video inference jobs, built with a FastAPI backend and a Next.js frontend.
  • Job Lifecycle Control: Users can now create, start, stop, restart, and delete video generation jobs directly through the UI, offering granular control over the inference process.
  • Enhanced Logging and Monitoring: Implemented real-time console logs for running jobs, with the ability to download full log files. An inference timer provides duration tracking, and progress/phase indicators offer visual feedback on job status.
  • Flexible Model and Parameter Configuration: The UI integrates with the FastVideo registry to list available models and allows configuration of various inference parameters, including steps, frames, resolution, guidance scale, seed, GPU count, DiT CPU offload, Text Encoder CPU offload, and FSDP inference.
  • Robust Backend Infrastructure: The backend features a FastAPI server that manages an in-memory job store, caches model instances to optimize loading times, and includes improved error handling for worker processes, ensuring server stability even if individual jobs fail.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Added patterns to ignore Next.js generated files and directories.
  • .python-version
    • Added a file specifying Python version 3.12.
  • fastvideo/distributed/parallel_state.py
    • Added a conditional check to set the device only if the platform is CUDA-alike or NPU, preventing errors on non-GPU systems.
  • fastvideo/entrypoints/video_generator.py
    • Modified VideoGenerator initialization and from_pretrained/from_fastvideo_args methods to accept an optional log_queue for forwarding worker logs.
    • Refactored generate_video to use an internal _generate_video_impl and added logic to set and clear the log_queue on the executor.
  • fastvideo/models/encoders/stepllm.py
    • Updated the import statement for PreTrainedModel from transformers.modeling_utils to transformers.
  • fastvideo/registry.py
    • Added a new function get_registered_model_paths to retrieve a sorted list of all registered HuggingFace model paths, facilitating UI integration.
  • fastvideo/worker/executor.py
    • Modified the Executor class constructor to accept an optional log_queue parameter.
  • fastvideo/worker/multiproc_executor.py
    • Implemented a _make_queue_log_handler function to create a QueueHandler for forwarding logs to a multiprocessing queue.
    • Updated _init_executor to pass the log_queue to worker processes during initialization.
    • Added set_log_queue and clear_log_queue methods to MultiprocExecutor for dynamic log queue management in worker processes.
    • Improved worker initialization error handling to send detailed error messages, including tracebacks, back to the parent process.
    • Added a check in shutdown to ensure workers exist before attempting to shut them down.
    • Modified worker_main to add an initial log handler to the fastvideo logger before model loading and to manage log queue handlers dynamically.
    • Enhanced wait_for_ready to collect and report errors from multiple worker processes during initialization.
    • Implemented _set_log_queue and _clear_log_queue methods within WorkerMultiprocProc to manage log handlers for individual workers.
  • pyproject.toml
    • Added fastapi and uvicorn as new dependencies under the 'Job Runner' section.
  • ui/.gitignore
    • Added new ignore patterns for Next.js and Node.js generated files and directories.
  • ui/README.md
    • Added a comprehensive README file detailing the FastVideo Job Runner UI, including quick start instructions, features, API endpoints, and architectural overview.
  • ui/init.py
    • Added an SPDX license identifier to the file.
  • ui/main.py
    • Added a main entry point to allow the UI server to be run as a Python module (python -m ui).
  • ui/eslint.config.mjs
    • Added ESLint configuration for the Next.js project, including core web vitals and TypeScript rules.
  • ui/job_runner.py
    • Added a new Python module implementing the core job runner logic, including job status enumeration, log buffering, job dataclass, and the JobRunner class for managing job lifecycle, execution, and generator caching.
  • ui/next.config.ts
    • Added Next.js configuration file, enabling React Compiler.
  • ui/package.json
    • Added a new package.json file defining Node.js dependencies (Next.js, React, Tailwind CSS, ESLint) and scripts for development, build, and concurrent API/web server startup.
  • ui/postcss.config.mjs
    • Added PostCSS configuration for Tailwind CSS integration.
  • ui/public/logo.svg
    • Added the FastVideo logo as an SVG asset.
  • ui/server.py
    • Added a new Python module implementing the FastAPI server for the UI, providing REST endpoints for model listing, job CRUD operations, job start/stop, log retrieval, and video/log file downloads.
  • ui/src/app/Layout.module.css
    • Added CSS module for general page layout, section headers, and placeholder styling.
  • ui/src/app/globals.css
    • Added global CSS file defining custom CSS variables for theming, basic resets, and base styles for body and form elements.
  • ui/src/app/layout.tsx
    • Added the root layout component for the Next.js application, including metadata, global CSS imports, and a header with the FastVideo logo.
  • ui/src/app/page.tsx
    • Added the main page component for the Next.js UI, responsible for fetching and displaying a list of jobs, and integrating the job creation button and job cards.
  • ui/src/components/CreateJobButton.tsx
    • Added a React component for the 'Create Job' button, which triggers the job creation modal.
  • ui/src/components/CreateJobModal.tsx
    • Added a React component for the job creation modal, providing a form for users to input job parameters and select models.
  • ui/src/components/JobCard.tsx
    • Added a React component to display individual job details, status, progress, and actions such as start, stop, delete, download video, and toggle console logs.
  • ui/src/components/styles/Badge.module.css
    • Added CSS module for styling job status badges with different colors.
  • ui/src/components/styles/Button.module.css
    • Added CSS module for styling various button types (primary, small, start, stop, delete, view, console) and their states.
  • ui/src/components/styles/Card.module.css
    • Added CSS module for general card styling, including background, border, padding, and shadow.
  • ui/src/components/styles/Console.module.css
    • Added CSS module for styling the console output area within job cards, including scrollbar styles.
  • ui/src/components/styles/Form.module.css
    • Added CSS module for styling form rows, labels, and advanced settings sections.
  • ui/src/components/styles/Header.module.css
    • Added CSS module for styling the application header, including title and subtitle.
  • ui/src/components/styles/JobCard.module.css
    • Added CSS module for styling individual job cards, including header, prompt, meta information, actions, and console container.
  • ui/src/components/styles/Modal.module.css
    • Added CSS module for styling modal dialogs, including backdrop, content, and close button.
  • ui/src/components/styles/ProgressBar.module.css
    • Added CSS module for styling progress bars, including container, background, fill, and label.
  • ui/src/components/styles/Toast.module.css
    • Added CSS module for styling toast notifications, including container and individual toast appearance.
  • ui/src/lib/api.ts
    • Added a TypeScript API client module for making requests to the FastAPI backend, including functions for fetching models, managing jobs, and retrieving logs/files.
  • ui/src/lib/types.ts
    • Added a TypeScript module defining interfaces for Job and Model data structures, ensuring type safety for frontend-backend communication.
  • ui/tsconfig.json
    • Added TypeScript configuration file for the Next.js project, specifying compiler options and path aliases.
Activity
  • The pull request introduces a new web-based UI for managing video inference jobs, with a FastAPI backend and a Next.js frontend.
  • The UI allows users to create, start, stop, restart, and delete jobs, and configure various inference parameters.
  • Real-time console logs, log downloads, and inference timers are included for better monitoring.
  • The backend now handles log forwarding from worker processes and improved error reporting during worker initialization.
  • New dependencies for FastAPI and Uvicorn were added to pyproject.toml.
  • Numerous new files were added under the ui/ directory, comprising the entire frontend application and its Python backend components.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

dsynkd added 28 commits March 1, 2026 10:05
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive job runner UI with a FastAPI backend and a Next.js frontend. The backend architecture is robust, featuring solid error handling in the multiprocessing setup and an effective caching mechanism for video generators. The frontend provides a clean and intuitive interface for managing jobs, complete with live log polling and status updates. My review includes a few suggestions for improvement, such as fixing a bug in worker error handling, enhancing the Executor interface design, and optimizing frontend polling efficiency. Overall, this is an excellent and well-implemented feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant