Skip to content

feat: add precision option (fp32/fp16/bf16) in settings#703

Open
NULL204 wants to merge 136 commits into
EutropicAI:mainfrom
NULL204:main
Open

feat: add precision option (fp32/fp16/bf16) in settings#703
NULL204 wants to merge 136 commits into
EutropicAI:mainfrom
NULL204:main

Conversation

@NULL204

@NULL204 NULL204 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Add a precision selector to the settings page (default fp32) that is sent to the core. bf16 keeps fp16's VRAM savings without the overflow that produces black/NaN output on some transformer models.

Tohrusky and others added 15 commits August 1, 2025 14:15
* doc: update README.md
* ci: update Release.yml

* ci: fix actions/upload-artifact@v4
* feat: option for using tile
* ci: fix codecov

* build: bump ccrestoration to 0.2.2
* build: use uv as pkg manager

* build: update pre-commit-config

* ci: update

* build: remove torchaudio

* ci: uv sync --no-default-groups --group dev

* build: update pyinstaller

* build: uv default run will auto sync all pkgs
Add a precision config field (fp32/fp16/bf16, default fp32) and map it to
cccv's fp16/bf16 arguments. bf16 avoids the fp16 numerical overflow that
yields NaN output on some transformer models, at the same VRAM savings as
fp16.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a precision selector to the settings page (default fp32) that is sent
to the core. bf16 keeps fp16's VRAM savings without the overflow that
produces black/NaN output on some transformer models.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 16:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a user-selectable compute precision setting (FP32/FP16/BF16) to Final2x and propagates it into the generated core config.

Changes:

  • Introduces a new precision field in settings store and core config payload
  • Adds a precision selector to the Final2x settings UI
  • Adds localized UI strings and a shared options list for precision choices

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/shared/type/core.ts Extends core config type to include precision
src/renderer/src/views/Final2xSettings.vue Adds UI controls for selecting precision
src/renderer/src/utils/getFinal2xCoreConfig.ts Serializes precision into the core config
src/renderer/src/utils/SROptions.ts Defines the selectable precision options
src/renderer/src/store/SRSettingsStore.ts Stores the selected precision with a default
src/renderer/src/locales/zh.ts Adds i18n strings for precision UI/help text
src/renderer/src/locales/ja.ts Adds i18n strings for precision UI/help text
src/renderer/src/locales/fr.ts Adds i18n strings for precision UI/help text
src/renderer/src/locales/en.ts Adds i18n strings for precision UI/help text

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/shared/type/core.ts
Comment on lines 7 to 11
output_path: string
input_path: string[]
use_tile: boolean
precision: string
save_format: string
const ghProxy: Ref<string | null> = ref(null)
const targetScale: Ref<number | null> = ref(null)
const useTile: Ref<boolean> = ref(true)
const precision: Ref<string> = ref('fp32')
Comment on lines +19 to +23
export const precisionList: Ref<any[]> = ref([
{ value: 'fp32', label: 'FP32' },
{ value: 'fp16', label: 'FP16' },
{ value: 'bf16', label: 'BF16' },
])

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

Copy link
Copy Markdown

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 new 'Precision' setting (supporting FP32, FP16, and BF16) across the application, including UI controls, localized descriptions, state management, and configuration generation. The review feedback focuses on improving type safety by replacing generic types (string and any[]) with literal union types ('fp32' | 'fp16' | 'bf16') for the precision state, configuration interface, and options list.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

const ghProxy: Ref<string | null> = ref(null)
const targetScale: Ref<number | null> = ref(null)
const useTile: Ref<boolean> = ref(true)
const precision: Ref<string> = ref('fp32')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using a generic string type for precision reduces type safety. Since the precision options are fixed (fp32, fp16, bf16), it is highly recommended to use a union of literal types to prevent invalid values and improve IDE autocompletion.

Suggested change
const precision: Ref<string> = ref('fp32')
const precision: Ref<'fp32' | 'fp16' | 'bf16'> = ref('fp32')

Comment thread src/shared/type/core.ts Outdated
output_path: string
input_path: string[]
use_tile: boolean
precision: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using a generic string type for precision in the core configuration interface reduces type safety. Specifying the exact allowed values ('fp32' | 'fp16' | 'bf16') ensures that only valid precision configurations are sent to the core.

Suggested change
precision: string
precision: 'fp32' | 'fp16' | 'bf16'

{ value: '.tiff', label: 'TIFF' },
])

export const precisionList: Ref<any[]> = ref([

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Avoid using any[] for precisionList. Typing the array elements with the specific shape and literal values improves type safety and prevents potential runtime errors.

Suggested change
export const precisionList: Ref<any[]> = ref([
export const precisionList: Ref<{ value: 'fp32' | 'fp16' | 'bf16'; label: string }[]> = ref([

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.

5 participants