Skip to content

🎥 Make videos programmatically with React

Add context to model settings

JonnyBurger2c43f5f0538e
diff --git a/packages/studio/src/components/ModelsSettings.tsx b/packages/studio/src/components/ModelsSettings.tsx
index af1e5e2188..00fc2ae44f 100644
--- a/packages/studio/src/components/ModelsSettings.tsx
+++ b/packages/studio/src/components/ModelsSettings.tsx
@@ -26,6 +26,13 @@ const container: React.CSSProperties = {
width: '100%',
};
+const overview: React.CSSProperties = {
+ color: LIGHT_TEXT,
+ fontSize: 13,
+ lineHeight: 1.5,
+ margin: '0 0 16px',
+};
+
const section: React.CSSProperties = {
paddingBottom: 16,
};
@@ -145,19 +152,31 @@ const OptionalModelPackage: React.FC<{
export const ModelsSettings: React.FC = () => {
return (
<div style={container}>
+ <p style={overview}>
+ Models are downloaded automatically when needed. You can also manage the
+ browser cache here.
+ </p>
<OptionalModelPackage
label="Transcription"
packageName={WHISPER_WEBGPU_PACKAGE}
style={section}
>
- <LazyWhisperModels indent={false} visible />
+ <LazyWhisperModels
+ description="Select an audio or video asset to transcribe it."
+ indent={false}
+ visible
+ />
</OptionalModelPackage>
<OptionalModelPackage
label="Video matting"
packageName={VIDEO_MATTING_PACKAGE}
style={lastSection}
>
- <LazyVideoMattingModels indent={false} visible />
+ <LazyVideoMattingModels
+ description="Select a video asset to separate background and foreground."
+ indent={false}
+ visible
+ />
</OptionalModelPackage>
</div>
);
diff --git a/packages/studio/src/components/Transcription/Models.tsx b/packages/studio/src/components/Transcription/Models.tsx
index c3bde2c685..e7d303288a 100644
--- a/packages/studio/src/components/Transcription/Models.tsx
+++ b/packages/studio/src/components/Transcription/Models.tsx
@@ -12,9 +12,10 @@ import {ModelManager} from '../ModelManager';
const AVAILABLE_MODELS = getAvailableModels();
export const Models: React.FC<{
+ readonly description: string;
readonly indent: boolean;
readonly visible: boolean;
-}> = ({indent, visible}) => {
+}> = ({description, indent, visible}) => {
const isModelCached = useCallback(
(model: WhisperWebGpuModel) => isWhisperModelCached({model}),
[],
@@ -39,7 +40,7 @@ export const Models: React.FC<{
<ModelManager
ariaLabel="Whisper models"
availableModels={AVAILABLE_MODELS}
- description="Models are downloaded automatically when a transcription starts. You can also manage the browser cache here."
+ description={description}
indent={indent}
isModelCached={isModelCached}
loadModel={loadModel}
diff --git a/packages/studio/src/components/Transcription/TranscriptionModal.tsx b/packages/studio/src/components/Transcription/TranscriptionModal.tsx
index 3950cdd308..9075fd0ba9 100644
--- a/packages/studio/src/components/Transcription/TranscriptionModal.tsx
+++ b/packages/studio/src/components/Transcription/TranscriptionModal.tsx
@@ -939,7 +939,11 @@ export const TranscriptionModal: React.FC<TranscriptionModalState> = ({
validationMessage={chunkValidationMessage}
/>
</div>
- <Models indent visible={tab === 'models'} />
+ <Models
+ description="Select an audio or video asset to transcribe it. Models are downloaded automatically when needed. You can also manage the browser cache here."
+ indent
+ visible={tab === 'models'}
+ />
</div>
</div>
</DismissableModal>
diff --git a/packages/studio/src/components/VideoMatting/Models.tsx b/packages/studio/src/components/VideoMatting/Models.tsx
index 5b3a3a0ad5..ca88c0e690 100644
--- a/packages/studio/src/components/VideoMatting/Models.tsx
+++ b/packages/studio/src/components/VideoMatting/Models.tsx
@@ -11,9 +11,10 @@ import {ModelManager} from '../ModelManager';
const AVAILABLE_MODELS = getAvailableModels();
export const Models: React.FC<{
+ readonly description: string;
readonly indent: boolean;
readonly visible: boolean;
-}> = ({indent, visible}) => {
+}> = ({description, indent, visible}) => {
const isModelCached = useCallback(
(model: VideoMattingModel) => isVideoMattingModelCached({model}),
[],
@@ -35,7 +36,7 @@ export const Models: React.FC<{
<ModelManager
ariaLabel="Video matting models"
availableModels={AVAILABLE_MODELS}
- description="Models are downloaded automatically when video separation starts. You can also manage the browser cache here."
+ description={description}
indent={indent}
isModelCached={isModelCached}
loadModel={loadModel}
diff --git a/packages/studio/src/components/VideoMatting/VideoMattingModal.tsx b/packages/studio/src/components/VideoMatting/VideoMattingModal.tsx
index f3fce69321..3090524531 100644
--- a/packages/studio/src/components/VideoMatting/VideoMattingModal.tsx
+++ b/packages/studio/src/components/VideoMatting/VideoMattingModal.tsx
@@ -383,7 +383,11 @@ export const VideoMattingModal: React.FC<VideoMattingModalState> = ({
</div>
</div>
</div>
- <Models indent visible={tab === 'models'} />
+ <Models
+ description="Select a video asset to separate background and foreground. Models are downloaded automatically when needed. You can also manage the browser cache here."
+ indent
+ visible={tab === 'models'}
+ />
</div>
</div>
</DismissableModal>