jbilcke-hf HF staff commited on
Commit
48cf37b
1 Parent(s): b205a69

preparing settings for more vendors

Browse files
Files changed (49) hide show
  1. src/components/core/providers/ComputeProviderLogo.tsx +31 -0
  2. src/components/core/providers/ComputeProviderName.tsx +25 -0
  3. src/components/core/providers/logos/anthropic.png +0 -0
  4. src/components/core/providers/logos/cohere.png +0 -0
  5. src/components/core/providers/logos/elevenlabs.png +0 -0
  6. src/components/core/providers/logos/everartai.png +0 -0
  7. src/components/core/providers/logos/falai.png +0 -0
  8. src/components/core/providers/logos/fireworks.png +0 -0
  9. src/components/core/providers/logos/google.png +0 -0
  10. src/components/core/providers/logos/groq.png +0 -0
  11. src/components/core/providers/logos/hedra.png +0 -0
  12. src/components/core/providers/logos/huggingface.png +0 -0
  13. src/components/core/providers/logos/index.ts +59 -0
  14. src/components/core/providers/logos/kitsai.png +0 -0
  15. src/components/core/providers/logos/kuaishou.png +0 -0
  16. src/components/core/providers/logos/leonardoai.png +0 -0
  17. src/components/core/providers/logos/lumalabs.png +0 -0
  18. src/components/core/providers/logos/midjourney.png +0 -0
  19. src/components/core/providers/logos/mistralai.png +0 -0
  20. src/components/core/providers/logos/modelslab.jpeg +3 -0
  21. src/components/core/providers/logos/none.png +0 -0
  22. src/components/core/providers/logos/openai.png +0 -0
  23. src/components/core/providers/logos/replicate.jpeg +3 -0
  24. src/components/core/providers/logos/runwayml.png +0 -0
  25. src/components/core/providers/logos/stabilityai.png +0 -0
  26. src/components/core/providers/logos/suno.png +0 -0
  27. src/components/core/providers/logos/udio.png +0 -0
  28. src/components/settings/constants.ts +47 -2
  29. src/components/settings/video.tsx +20 -3
  30. src/components/toolbars/top-menu/assistant/index.tsx +2 -15
  31. src/components/toolbars/top-menu/image/index.tsx +8 -18
  32. src/components/toolbars/top-menu/lists/AssistantModelList.tsx +51 -35
  33. src/components/toolbars/top-menu/lists/ImageDepthModelList.tsx +78 -0
  34. src/components/toolbars/top-menu/lists/ImageGenerationModelList.tsx +52 -36
  35. src/components/toolbars/top-menu/lists/ImageSegmentationModelList.tsx +77 -0
  36. src/components/toolbars/top-menu/lists/ImageUpscalingModelList.tsx +52 -36
  37. src/components/toolbars/top-menu/lists/MusicGenerationModelList.tsx +51 -35
  38. src/components/toolbars/top-menu/lists/RenderingStrategyList.tsx +1 -1
  39. src/components/toolbars/top-menu/lists/SoundGenerationModelList.tsx +51 -35
  40. src/components/toolbars/top-menu/lists/VideoDepthModelList.tsx +78 -0
  41. src/components/toolbars/top-menu/lists/VideoGenerationModelList.tsx +51 -39
  42. src/components/toolbars/top-menu/lists/VideoSegmentationModelList.tsx +78 -0
  43. src/components/toolbars/top-menu/lists/VideoUpscalingModelList.tsx +52 -36
  44. src/components/toolbars/top-menu/lists/VoiceGenerationModelList.tsx +51 -35
  45. src/components/toolbars/top-menu/lists/formatProvider.ts +8 -0
  46. src/components/toolbars/top-menu/music/index.tsx +2 -13
  47. src/components/toolbars/top-menu/sound/index.tsx +2 -13
  48. src/components/toolbars/top-menu/video/index.tsx +9 -17
  49. src/components/toolbars/top-menu/voice/index.tsx +3 -13
src/components/core/providers/ComputeProviderLogo.tsx ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Image from "next/image"
2
+ import { cn } from "@aitube/timeline"
3
+
4
+ import { ComputeProvider } from "@/types"
5
+ import { formatProvider } from "@/components/toolbars/top-menu/lists/formatProvider"
6
+
7
+ import { computeProvidersLogos } from "./logos"
8
+
9
+ export function ComputeProviderLogo({
10
+ provider = ComputeProvider.NONE,
11
+ height = 28,
12
+ className = "",
13
+ }: {
14
+ provider?: ComputeProvider
15
+ height?: number | string
16
+ className?: string
17
+ }) {
18
+
19
+ const staticImageData = computeProvidersLogos[
20
+ provider || ComputeProvider.NONE
21
+ ] || computeProvidersLogos.NONE
22
+
23
+ return (
24
+ <Image
25
+ src={staticImageData}
26
+ height={height as any}
27
+ alt={formatProvider(provider)}
28
+ className={cn(className)}
29
+ />
30
+ )
31
+ }
src/components/core/providers/ComputeProviderName.tsx ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { cn } from "@aitube/timeline"
2
+
3
+ import { ComputeProvider } from "@/types"
4
+ import { formatProvider } from "@/components/toolbars/top-menu/lists/formatProvider"
5
+
6
+ import { ComputeProviderLogo } from "./ComputeProviderLogo"
7
+
8
+ export function ComputeProviderName({
9
+ className = "",
10
+ children = ComputeProvider.NONE,
11
+ }: {
12
+ className?: string
13
+ children?: ComputeProvider
14
+ }) {
15
+ return (
16
+ <div className={cn(`flex flex-row space-x-2 items-center`, className)}>
17
+ <ComputeProviderLogo
18
+ provider={children}
19
+ height={18}
20
+ className={cn(`rounded-full`)}
21
+ />
22
+ <div>{formatProvider(children)}</div>
23
+ </div>
24
+ )
25
+ }
src/components/core/providers/logos/anthropic.png ADDED
src/components/core/providers/logos/cohere.png ADDED
src/components/core/providers/logos/elevenlabs.png ADDED
src/components/core/providers/logos/everartai.png ADDED
src/components/core/providers/logos/falai.png ADDED
src/components/core/providers/logos/fireworks.png ADDED
src/components/core/providers/logos/google.png ADDED
src/components/core/providers/logos/groq.png ADDED
src/components/core/providers/logos/hedra.png ADDED
src/components/core/providers/logos/huggingface.png ADDED
src/components/core/providers/logos/index.ts ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { StaticImageData } from "next/image"
2
+
3
+ import { ComputeProvider } from "@/types"
4
+
5
+ import none from "./none.png"
6
+ import anthropic from "./anthropic.png"
7
+ import cohere from "./cohere.png"
8
+ import elevenlabs from "./elevenlabs.png"
9
+ import everartai from "./everartai.png"
10
+ import falai from "./falai.png"
11
+ import fireworks from "./fireworks.png"
12
+ import google from "./google.png"
13
+ import groq from "./groq.png"
14
+ import hedra from "./hedra.png"
15
+ import huggingface from "./huggingface.png"
16
+ import kitsai from "./kitsai.png"
17
+ import kuaishou from "./kuaishou.png"
18
+ import leonardoai from "./leonardoai.png"
19
+ import lumalabs from "./lumalabs.png"
20
+ import midjourney from "./midjourney.png"
21
+ import mistralai from "./mistralai.png"
22
+ import modelslab from "./modelslab.jpeg"
23
+ import openai from "./openai.png"
24
+ import replicate from "./replicate.jpeg"
25
+ import runwayml from "./runwayml.png"
26
+ import stabilityai from "./stabilityai.png"
27
+ import suno from "./suno.png"
28
+ import udio from "./udio.png"
29
+
30
+ export const computeProvidersLogos: Record<ComputeProvider, StaticImageData> = {
31
+ [ComputeProvider.NONE]: none,
32
+ [ComputeProvider.ANTHROPIC]: anthropic,
33
+ [ComputeProvider.COHERE]: cohere,
34
+ [ComputeProvider.ELEVENLABS]: elevenlabs,
35
+ [ComputeProvider.FALAI]: falai,
36
+ [ComputeProvider.FIREWORKSAI]: fireworks,
37
+ [ComputeProvider.GOOGLE]: google,
38
+ [ComputeProvider.GROQ]: groq,
39
+ [ComputeProvider.HEDRA]: hedra,
40
+ [ComputeProvider.HUGGINGFACE]: huggingface,
41
+ [ComputeProvider.KITSAI]: kitsai,
42
+ [ComputeProvider.LUMALABS]: lumalabs,
43
+ [ComputeProvider.MIDJOURNEY]: midjourney,
44
+ [ComputeProvider.MISTRALAI]: mistralai,
45
+ [ComputeProvider.MODELSLAB]: modelslab,
46
+ [ComputeProvider.OPENAI]: openai,
47
+ [ComputeProvider.REPLICATE]: replicate,
48
+ [ComputeProvider.RUNWAYML]: runwayml,
49
+ [ComputeProvider.STABILITYAI]: stabilityai,
50
+ [ComputeProvider.SUNO]: suno,
51
+ [ComputeProvider.UDIO]: udio,
52
+ [ComputeProvider.CUSTOM]: none,
53
+ [ComputeProvider.COMFY_HUGGINGFACE]: huggingface,
54
+ [ComputeProvider.COMFY_REPLICATE]: replicate,
55
+ [ComputeProvider.COMFY_COMFYICU]: none,
56
+ [ComputeProvider.KUAISHOU]: kuaishou,
57
+ [ComputeProvider.LEONARDOAI]: leonardoai,
58
+ [ComputeProvider.EVERARTAI]: everartai,
59
+ }
src/components/core/providers/logos/kitsai.png ADDED
src/components/core/providers/logos/kuaishou.png ADDED
src/components/core/providers/logos/leonardoai.png ADDED
src/components/core/providers/logos/lumalabs.png ADDED
src/components/core/providers/logos/midjourney.png ADDED
src/components/core/providers/logos/mistralai.png ADDED
src/components/core/providers/logos/modelslab.jpeg ADDED

Git LFS Details

  • SHA256: c3061c58c94530f8bc14accbae864b6091cca99938a7312b454f0cfc258575b2
  • Pointer size: 128 Bytes
  • Size of remote file: 559 Bytes
src/components/core/providers/logos/none.png ADDED
src/components/core/providers/logos/openai.png ADDED
src/components/core/providers/logos/replicate.jpeg ADDED

Git LFS Details

  • SHA256: 0611a798a718459b2ac63c180c662378eba76de3fbff1a1dfa7ce7bafc73970b
  • Pointer size: 128 Bytes
  • Size of remote file: 762 Bytes
src/components/core/providers/logos/runwayml.png ADDED
src/components/core/providers/logos/stabilityai.png ADDED
src/components/core/providers/logos/suno.png ADDED
src/components/core/providers/logos/udio.png ADDED
src/components/settings/constants.ts CHANGED
@@ -220,7 +220,6 @@ export const availableModelsForImageGeneration: Partial<Record<ComputeProvider,
220
  ],
221
  }
222
 
223
- // should we call this upscaling or post-processing?
224
  export const availableModelsForImageUpscaling: Partial<Record<ComputeProvider, string[]>> = {
225
  [ComputeProvider.FALAI]: [
226
  "fal-ai/ccsr",
@@ -231,6 +230,37 @@ export const availableModelsForImageUpscaling: Partial<Record<ComputeProvider, s
231
  ],
232
  }
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  export const availableModelsForVideoGeneration: Partial<Record<ComputeProvider, string[]>> = {
235
  [ComputeProvider.FALAI]: [
236
  "fal-ai/stable-video",
@@ -272,7 +302,22 @@ export const availableModelsForVideoGeneration: Partial<Record<ComputeProvider,
272
  }
273
 
274
  export const availableModelsForVideoUpscaling: Partial<Record<ComputeProvider, string[]>> = {
275
- [ComputeProvider.FALAI]: [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  ]
277
  }
278
 
 
220
  ],
221
  }
222
 
 
223
  export const availableModelsForImageUpscaling: Partial<Record<ComputeProvider, string[]>> = {
224
  [ComputeProvider.FALAI]: [
225
  "fal-ai/ccsr",
 
230
  ],
231
  }
232
 
233
+ export const availableModelsForImageDepth: Partial<Record<ComputeProvider, string[]>> = {
234
+ [ComputeProvider.FALAI]: [
235
+ "fal-ai/imageutils/marigold-depth",
236
+ "fal-ai/imageutils/depth",
237
+ ],
238
+ [ComputeProvider.HUGGINGFACE]: [
239
+ "depth-anything/Depth-Anything-V2-Large",
240
+ "depth-anything/Depth-Anything-V2-Base",
241
+ "depth-anything/Depth-Anything-V2-Small",
242
+ ],
243
+ [ComputeProvider.REPLICATE]: [
244
+ "cjwbw/depth-anything",
245
+ "adirik/marigold"
246
+ ],
247
+ }
248
+
249
+ export const availableModelsForImageSegmentation: Partial<Record<ComputeProvider, string[]>> = {
250
+ [ComputeProvider.FALAI]: [
251
+ "fal-ai/imageutils/sam",
252
+ "fal-ai/tiny-sam"
253
+ ],
254
+ [ComputeProvider.HUGGINGFACE]: [
255
+ "ybelkada/segment-anything"
256
+ ],
257
+ [ComputeProvider.REPLICATE]: [
258
+ "yyjim/segment-anything-everything",
259
+ "cjwbw/semantic-segment-anything",
260
+ "pablodawson/segment-anything-automatic"
261
+ ],
262
+ }
263
+
264
  export const availableModelsForVideoGeneration: Partial<Record<ComputeProvider, string[]>> = {
265
  [ComputeProvider.FALAI]: [
266
  "fal-ai/stable-video",
 
302
  }
303
 
304
  export const availableModelsForVideoUpscaling: Partial<Record<ComputeProvider, string[]>> = {
305
+ [ComputeProvider.REPLICATE]: [
306
+ "lucataco/real-esrgan-video",
307
+ "pbarker/gfpgan-video"
308
+ ]
309
+ }
310
+
311
+ export const availableModelsForVideoDepth: Partial<Record<ComputeProvider, string[]>> = {
312
+ [ComputeProvider.REPLICATE]: [
313
+ "lucataco/depth-anything-video"
314
+ ]
315
+ }
316
+
317
+
318
+ export const availableModelsForVideoSegmentation: Partial<Record<ComputeProvider, string[]>> = {
319
+ [ComputeProvider.REPLICATE]: [
320
+ "cjwbw/cutie"
321
  ]
322
  }
323
 
src/components/settings/video.tsx CHANGED
@@ -9,9 +9,6 @@ import { availableComputeProvidersForVideos, computeProviderShortNames } from ".
9
  export function SettingsSectionVideo() {
10
  const defaultSettings = getDefaultSettingsState()
11
 
12
- const videoProvider = useSettings(s => s.videoProvider)
13
- const setVideoProvider = useSettings(s => s.setVideoProvider)
14
-
15
  const huggingFaceModelForVideo = useSettings(s => s.huggingFaceModelForVideo)
16
  const setHuggingFaceModelForVideo = useSettings(s => s.setHuggingFaceModelForVideo)
17
 
@@ -34,6 +31,26 @@ export function SettingsSectionVideo() {
34
  const videoNegativePrompt = useSettings(s => s.videoNegativePrompt)
35
  const setVideoNegativePrompt = useSettings(s => s.setVideoNegativePrompt)
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  const videoRenderingStrategy = useSettings(s => s.videoRenderingStrategy)
38
  const setVideoRenderingStrategy = useSettings(s => s.setVideoRenderingStrategy)
39
 
 
9
  export function SettingsSectionVideo() {
10
  const defaultSettings = getDefaultSettingsState()
11
 
 
 
 
12
  const huggingFaceModelForVideo = useSettings(s => s.huggingFaceModelForVideo)
13
  const setHuggingFaceModelForVideo = useSettings(s => s.setHuggingFaceModelForVideo)
14
 
 
31
  const videoNegativePrompt = useSettings(s => s.videoNegativePrompt)
32
  const setVideoNegativePrompt = useSettings(s => s.setVideoNegativePrompt)
33
 
34
+ const videoProvider = useSettings(s => s.videoProvider)
35
+ const setVideoProvider = useSettings(s => s.setVideoProvider)
36
+ const videoGenerationModel = useSettings(s => s.videoGenerationModel)
37
+ const setVideoGenerationModel = useSettings(s => s.setVideoGenerationModel)
38
+
39
+ const videoUpscalingProvider = useSettings(s => s.videoUpscalingProvider)
40
+ const setVideoUpscalingProvider = useSettings(s => s.setVideoUpscalingProvider)
41
+ const videoUpscalingModel = useSettings(s => s.videoUpscalingModel)
42
+ const setVideoUpscalingModel = useSettings(s => s.setVideoUpscalingModel)
43
+
44
+ const videoDepthProvider = useSettings(s => s.videoDepthProvider)
45
+ const setVideoDepthProvider = useSettings(s => s.setVideoDepthProvider)
46
+ const videoDepthModel = useSettings(s => s.videoDepthModel)
47
+ const setVideoDepthModel = useSettings(s => s.setVideoDepthModel)
48
+
49
+ const videoSegmentationProvider = useSettings(s => s.videoSegmentationProvider)
50
+ const setVideoSegmentationProvider = useSettings(s => s.setVideoSegmentationProvider)
51
+ const videoSegmentationModel = useSettings(s => s.videoSegmentationModel)
52
+ const setVideoSegmentationModel = useSettings(s => s.setVideoSegmentationModel)
53
+
54
  const videoRenderingStrategy = useSettings(s => s.videoRenderingStrategy)
55
  const setVideoRenderingStrategy = useSettings(s => s.setVideoRenderingStrategy)
56
 
src/components/toolbars/top-menu/assistant/index.tsx CHANGED
@@ -11,21 +11,13 @@ import {
11
  MenubarSubTrigger,
12
  MenubarTrigger
13
  } from "@/components/ui/menubar"
14
- import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
-
17
- import { ProviderList } from "../lists/ProviderList"
18
- import { availableComputeProvidersForAssistant } from "@/components/settings/constants"
19
- import { ComputeProvider, SettingsCategory } from "@/types"
20
  import { AssistantModelList } from "../lists/AssistantModelList"
21
  import { useInitAssistant } from "@/controllers/assistant/useAssistant"
22
 
23
  export function TopMenuAssistant() {
24
  const setShowSettings = useUI(s => s.setShowSettings)
25
- const assistantProvider = useSettings(s => s.assistantProvider)
26
- const setAssistantProvider = useSettings(s => s.setAssistantProvider)
27
- const assistantModel = useSettings(s => s.assistantModel)
28
- const setAssistantModel = useSettings(s => s.setAssistantModel)
29
 
30
  // this should only be called on and at only one place in the project!
31
  useInitAssistant()
@@ -37,12 +29,7 @@ export function TopMenuAssistant() {
37
  <MenubarSub>
38
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.ASSISTANT) }}>Show advanced settings</MenubarItem>
39
  <MenubarSeparator />
40
- <AssistantModelList provider={assistantProvider} current={assistantModel} setter={setAssistantModel} />
41
- <ProviderList providers={availableComputeProvidersForAssistant} current={assistantProvider} setter={(newProvider: ComputeProvider) => {
42
- if (assistantProvider === newProvider) { return }
43
- setAssistantProvider(newProvider)
44
- setAssistantModel(undefined)
45
- }} />
46
  <MenubarSeparator />
47
  <MenubarItem
48
  disabled
 
11
  MenubarSubTrigger,
12
  MenubarTrigger
13
  } from "@/components/ui/menubar"
 
14
  import { useUI } from "@/controllers/ui"
15
+ import { SettingsCategory } from "@/types"
 
 
 
16
  import { AssistantModelList } from "../lists/AssistantModelList"
17
  import { useInitAssistant } from "@/controllers/assistant/useAssistant"
18
 
19
  export function TopMenuAssistant() {
20
  const setShowSettings = useUI(s => s.setShowSettings)
 
 
 
 
21
 
22
  // this should only be called on and at only one place in the project!
23
  useInitAssistant()
 
29
  <MenubarSub>
30
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.ASSISTANT) }}>Show advanced settings</MenubarItem>
31
  <MenubarSeparator />
32
+ <AssistantModelList />
 
 
 
 
 
33
  <MenubarSeparator />
34
  <MenubarItem
35
  disabled
src/components/toolbars/top-menu/image/index.tsx CHANGED
@@ -14,26 +14,20 @@ import {
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
17
- import { ProviderList } from "../lists/ProviderList"
18
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
19
- import { availableComputeProvidersForImages } from "@/components/settings/constants"
20
  import { ImageGenerationModelList } from "../lists/ImageGenerationModelList"
21
  import { ImageUpscalingModelList } from "../lists/ImageUpscalingModelList"
22
  import { IsBusy } from "../IsBusy"
23
 
24
- import { ComputeProvider, SettingsCategory } from "@/types"
25
- import { useRenderer } from "@/controllers/renderer"
26
  import { useResolver } from "@/controllers/resolver/useResolver"
 
 
27
 
28
  export function TopMenuImage() {
29
  const nbPendingRequestsForImage = useResolver(s => s.nbPendingRequestsForImage)
30
  const setShowSettings = useUI(s => s.setShowSettings)
31
- const imageProvider = useSettings(s => s.imageProvider)
32
- const setImageProvider = useSettings(s => s.setImageProvider)
33
- const imageGenerationModel = useSettings(s => s.imageGenerationModel)
34
- const setImageGenerationModel = useSettings(s => s.setImageGenerationModel)
35
- const imageUpscalingModel = useSettings(s => s.imageUpscalingModel)
36
- const setImageUpscalingModel = useSettings(s => s.setImageUpscalingModel)
37
  const imageRenderingStrategy = useSettings((s) => s.imageRenderingStrategy)
38
  const setImageRenderingStrategy = useSettings((s) => s.setImageRenderingStrategy)
39
  return (
@@ -43,14 +37,10 @@ export function TopMenuImage() {
43
  <MenubarSub>
44
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.IMAGE) }}>Show advanced settings</MenubarItem>
45
  <MenubarSeparator />
46
- <ImageGenerationModelList provider={imageProvider} current={imageGenerationModel} setter={setImageGenerationModel} />
47
- <ImageUpscalingModelList provider={imageProvider} current={imageUpscalingModel} setter={setImageUpscalingModel} />
48
- <ProviderList providers={availableComputeProvidersForImages} current={imageProvider} setter={(newProvider: ComputeProvider) => {
49
- if (imageProvider === newProvider) { return }
50
- setImageProvider(newProvider)
51
- setImageGenerationModel(undefined)
52
- setImageUpscalingModel(undefined)
53
- }} />
54
  <RenderingStrategyList current={imageRenderingStrategy} setter={setImageRenderingStrategy} />
55
  <MenubarSeparator />
56
  <MenubarItem
 
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
 
17
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
 
18
  import { ImageGenerationModelList } from "../lists/ImageGenerationModelList"
19
  import { ImageUpscalingModelList } from "../lists/ImageUpscalingModelList"
20
  import { IsBusy } from "../IsBusy"
21
 
22
+ import { SettingsCategory } from "@/types"
 
23
  import { useResolver } from "@/controllers/resolver/useResolver"
24
+ import { ImageDepthModelList } from "../lists/ImageDepthModelList"
25
+ import { ImageSegmentationModelList } from "../lists/ImageSegmentationModelList"
26
 
27
  export function TopMenuImage() {
28
  const nbPendingRequestsForImage = useResolver(s => s.nbPendingRequestsForImage)
29
  const setShowSettings = useUI(s => s.setShowSettings)
30
+
 
 
 
 
 
31
  const imageRenderingStrategy = useSettings((s) => s.imageRenderingStrategy)
32
  const setImageRenderingStrategy = useSettings((s) => s.setImageRenderingStrategy)
33
  return (
 
37
  <MenubarSub>
38
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.IMAGE) }}>Show advanced settings</MenubarItem>
39
  <MenubarSeparator />
40
+ <ImageGenerationModelList />
41
+ <ImageUpscalingModelList/>
42
+ <ImageDepthModelList />
43
+ <ImageSegmentationModelList />
 
 
 
 
44
  <RenderingStrategyList current={imageRenderingStrategy} setter={setImageRenderingStrategy} />
45
  <MenubarSeparator />
46
  <MenubarItem
src/components/toolbars/top-menu/lists/AssistantModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,46 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForAssistant } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function AssistantModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForAssistant[provider] || []) : []
30
 
31
- if (models.length === 0) { return null }
32
-
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
  <Tag size="lg" color={TagColor.FUCHSIA}>ai&nbsp;assistant</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {model}
57
- </MenubarCheckboxItem>
 
 
 
 
 
 
 
 
 
 
58
  ))}
59
  </MenubarSubContent>
60
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForAssistant } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function AssistantModelList() {
23
+
24
+ const provider = useSettings(s => s.soundProvider)
25
+ const setProvider = useSettings(s => s.setSoundProvider)
26
+ const model = useSettings(s => s.assistantModel)
27
+ const setModel = useSettings(s => s.setAssistantModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForAssistant) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
31
 
 
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
  <Tag size="lg" color={TagColor.FUCHSIA}>ai&nbsp;assistant</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForAssistant[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/ImageDepthModelList.tsx ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use client"
2
+
3
+ import {
4
+ MenubarCheckboxItem,
5
+ MenubarSub,
6
+ MenubarSubContent,
7
+ MenubarSubTrigger,
8
+ } from "@/components/ui/menubar"
9
+
10
+ import { TagColor } from "@/components/tags/types"
11
+ import { Tag } from "@/components/tags/Tag"
12
+ import { ComputeProvider } from "@/types"
13
+ import { availableModelsForImageDepth } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
+ import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function ImageDepthModelList() {
23
+
24
+ const provider = useSettings(s => s.imageDepthProvider)
25
+ const setProvider = useSettings(s => s.setImageDepthProvider)
26
+ const model = useSettings(s => s.imageDepthModel)
27
+ const setModel = useSettings(s => s.setImageDepthModel)
28
+
29
+ const availableProviders = Object.keys(availableModelsForImageDepth) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
31
+
32
+ return (
33
+ <MenubarSub>
34
+ <MenubarSubTrigger>
35
+ <Tag size="lg" color={TagColor.SLATE}>depth&nbsp;mapper</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
+ </MenubarSubTrigger>
45
+ <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForImageDepth[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
+ ))}
75
+ </MenubarSubContent>
76
+ </MenubarSub>
77
+ )
78
+ }
src/components/toolbars/top-menu/lists/ImageGenerationModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,46 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForImageGeneration } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function ImageGenerationModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForImageGeneration[provider] || []) : []
30
 
31
- if (models.length === 0) { return null }
32
-
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
- <Tag size="lg" color={TagColor.BLUE}>generate&nbsp;image</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {model}
57
- </MenubarCheckboxItem>
 
 
 
 
 
 
 
 
 
 
58
  ))}
59
  </MenubarSubContent>
60
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForImageGeneration } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function ImageGenerationModelList() {
23
+
24
+ const provider = useSettings(s => s.imageProvider)
25
+ const setProvider = useSettings(s => s.setImageProvider)
26
+ const model = useSettings(s => s.imageGenerationModel)
27
+ const setModel = useSettings(s => s.setImageGenerationModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForImageGeneration) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
31
 
 
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
+ <Tag size="lg" color={TagColor.SKY}>generate&nbsp;image</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForImageGeneration[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/ImageSegmentationModelList.tsx ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use client"
2
+
3
+ import {
4
+ MenubarCheckboxItem,
5
+ MenubarSub,
6
+ MenubarSubContent,
7
+ MenubarSubTrigger,
8
+ } from "@/components/ui/menubar"
9
+
10
+ import { TagColor } from "@/components/tags/types"
11
+ import { Tag } from "@/components/tags/Tag"
12
+ import { ComputeProvider } from "@/types"
13
+ import { availableModelsForImageSegmentation } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
+ import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+
21
+ export function ImageSegmentationModelList() {
22
+
23
+ const provider = useSettings(s => s.imageSegmentationProvider)
24
+ const setProvider = useSettings(s => s.setImageSegmentationProvider)
25
+ const model = useSettings(s => s.imageSegmentationModel)
26
+ const setModel = useSettings(s => s.setImageSegmentationModel)
27
+
28
+ const availableProviders = Object.keys(availableModelsForImageSegmentation) as ComputeProvider[]
29
+ if (!availableProviders) { return null }
30
+
31
+ return (
32
+ <MenubarSub>
33
+ <MenubarSubTrigger>
34
+ <Tag size="lg" color={TagColor.ZINC}>segmentation</Tag>
35
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
36
+ <ComputeProviderLogo
37
+ provider={(provider && model) ? provider : undefined}
38
+ height={18}
39
+ className={cn(`rounded-full`)}
40
+ />
41
+ <div>{model || "None"}</div>
42
+ </div>
43
+ </MenubarSubTrigger>
44
+ <MenubarSubContent>
45
+ {availableProviders.map(p => (
46
+ <MenubarSub key={p}>
47
+ <MenubarSubTrigger>
48
+ <ComputeProviderName>{p}</ComputeProviderName>
49
+ </MenubarSubTrigger>
50
+ <MenubarSubContent>
51
+ {(availableModelsForImageSegmentation[p] || []).map(m => (
52
+ <MenubarCheckboxItem
53
+ key={m}
54
+ checked={provider === p && model === m}
55
+ disabled={hasNoPublicAPI(m)}
56
+ onClick={(e) => {
57
+ if (hasNoPublicAPI(m)) {
58
+ e.stopPropagation()
59
+ e.preventDefault()
60
+ return false
61
+ }
62
+ setProvider(p)
63
+ setModel(m)
64
+ e.stopPropagation()
65
+ e.preventDefault()
66
+ return false
67
+ }}>
68
+ {m}
69
+ </MenubarCheckboxItem>
70
+ ))}
71
+ </MenubarSubContent>
72
+ </MenubarSub>
73
+ ))}
74
+ </MenubarSubContent>
75
+ </MenubarSub>
76
+ )
77
+ }
src/components/toolbars/top-menu/lists/ImageUpscalingModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,46 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForImageUpscaling } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function ImageUpscalingModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForImageUpscaling[provider] || []) : []
30
 
31
- if (models.length === 0) { return null }
32
-
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
- <Tag size="lg" color={TagColor.INDIGO}>upscale&nbsp;image</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {model}
57
- </MenubarCheckboxItem>
 
 
 
 
 
 
 
 
 
 
58
  ))}
59
  </MenubarSubContent>
60
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForImageUpscaling } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function ImageUpscalingModelList() {
23
+
24
+ const provider = useSettings(s => s.imageUpscalingProvider)
25
+ const setProvider = useSettings(s => s.setImageUpscalingProvider)
26
+ const model = useSettings(s => s.imageUpscalingModel)
27
+ const setModel = useSettings(s => s.setImageUpscalingModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForImageUpscaling) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
31
 
 
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
+ <Tag size="lg" color={TagColor.BLUE}>upscale&nbsp;image</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForImageUpscaling[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/MusicGenerationModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,46 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForMusicGeneration } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function MusicGenerationModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForMusicGeneration[provider] || []) : []
30
 
31
- if (models.length === 0) { return null }
32
-
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
  <Tag size="lg" color={TagColor.LIME}>generate&nbsp;music</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {model}
57
- </MenubarCheckboxItem>
 
 
 
 
 
 
 
 
 
 
58
  ))}
59
  </MenubarSubContent>
60
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForMusicGeneration } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function MusicGenerationModelList() {
23
+
24
+ const provider = useSettings(s => s.musicProvider)
25
+ const setProvider = useSettings(s => s.setMusicProvider)
26
+ const model = useSettings(s => s.musicGenerationModel)
27
+ const setModel = useSettings(s => s.setMusicGenerationModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForMusicGeneration) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
31
 
 
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
  <Tag size="lg" color={TagColor.LIME}>generate&nbsp;music</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForMusicGeneration[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/RenderingStrategyList.tsx CHANGED
@@ -31,7 +31,7 @@ export function RenderingStrategyList({
31
  <MenubarSub>
32
  <MenubarSubTrigger>
33
  {/* todo display either autorender or manual render */}
34
- <Tag size="lg" color={TagColor.NEUTRAL}>auto render</Tag>
35
  {(strategyLabels as any)[current || ""] || "None"}
36
  </MenubarSubTrigger>
37
  <MenubarSubContent>
 
31
  <MenubarSub>
32
  <MenubarSubTrigger>
33
  {/* todo display either autorender or manual render */}
34
+ <Tag size="lg" color={TagColor.NEUTRAL}>auto&nbsp;rendering</Tag>
35
  {(strategyLabels as any)[current || ""] || "None"}
36
  </MenubarSubTrigger>
37
  <MenubarSubContent>
src/components/toolbars/top-menu/lists/SoundGenerationModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,46 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForSoundGeneration } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function SoundGenerationModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForSoundGeneration[provider] || []) : []
30
 
31
- if (models.length === 0) { return null }
32
-
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
  <Tag size="lg" color={TagColor.YELLOW}>generate&nbsp;sound</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {model}
57
- </MenubarCheckboxItem>
 
 
 
 
 
 
 
 
 
 
58
  ))}
59
  </MenubarSubContent>
60
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForSoundGeneration } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function SoundGenerationModelList() {
23
+
24
+ const provider = useSettings(s => s.soundProvider)
25
+ const setProvider = useSettings(s => s.setSoundProvider)
26
+ const model = useSettings(s => s.soundGenerationModel)
27
+ const setModel = useSettings(s => s.setSoundGenerationModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForSoundGeneration) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
31
 
 
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
  <Tag size="lg" color={TagColor.YELLOW}>generate&nbsp;sound</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForSoundGeneration[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/VideoDepthModelList.tsx ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use client"
2
+
3
+ import {
4
+ MenubarCheckboxItem,
5
+ MenubarSub,
6
+ MenubarSubContent,
7
+ MenubarSubTrigger,
8
+ } from "@/components/ui/menubar"
9
+
10
+ import { TagColor } from "@/components/tags/types"
11
+ import { Tag } from "@/components/tags/Tag"
12
+ import { ComputeProvider } from "@/types"
13
+ import { availableModelsForVideoDepth } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
+ import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function VideoDepthModelList() {
23
+
24
+ const provider = useSettings(s => s.videoDepthProvider)
25
+ const setProvider = useSettings(s => s.setVideoDepthProvider)
26
+ const model = useSettings(s => s.videoDepthModel)
27
+ const setModel = useSettings(s => s.setVideoDepthModel)
28
+
29
+ const availableProviders = Object.keys(availableModelsForVideoDepth) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
31
+
32
+ return (
33
+ <MenubarSub>
34
+ <MenubarSubTrigger>
35
+ <Tag size="lg" color={TagColor.SLATE}>depth&nbsp;mapper</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
+ </MenubarSubTrigger>
45
+ <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForVideoDepth[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
+ ))}
75
+ </MenubarSubContent>
76
+ </MenubarSub>
77
+ )
78
+ }
src/components/toolbars/top-menu/lists/VideoGenerationModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,50 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForVideoGeneration } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function VideoGenerationModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForVideoGeneration[provider] || []) : []
30
 
31
- if (models.length === 0) { return null }
32
-
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
  <Tag size="lg" color={TagColor.RED}>generate&nbsp;video</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {
57
- // if the model is unavailable, we should add a tooltip like this:
58
- // https://x.com/flngr/status/1800968844581929094
59
- model
60
- }
61
- </MenubarCheckboxItem>
 
 
 
 
 
 
62
  ))}
63
  </MenubarSubContent>
64
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForVideoGeneration } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function VideoGenerationModelList() {
23
+
24
+ const provider = useSettings(s => s.videoProvider)
25
+ const setProvider = useSettings(s => s.setVideoProvider)
26
+ const model = useSettings(s => s.videoGenerationModel)
27
+ const setModel = useSettings(s => s.setVideoGenerationModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForVideoGeneration) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
31
 
 
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
  <Tag size="lg" color={TagColor.RED}>generate&nbsp;video</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForVideoGeneration[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/VideoSegmentationModelList.tsx ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use client"
2
+
3
+ import {
4
+ MenubarCheckboxItem,
5
+ MenubarSub,
6
+ MenubarSubContent,
7
+ MenubarSubTrigger,
8
+ } from "@/components/ui/menubar"
9
+
10
+ import { TagColor } from "@/components/tags/types"
11
+ import { Tag } from "@/components/tags/Tag"
12
+ import { ComputeProvider } from "@/types"
13
+ import { availableModelsForVideoSegmentation } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
+ import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function VideoSegmentationModelList() {
23
+
24
+ const provider = useSettings(s => s.videoSegmentationProvider)
25
+ const setProvider = useSettings(s => s.setVideoSegmentationProvider)
26
+ const model = useSettings(s => s.videoSegmentationModel)
27
+ const setModel = useSettings(s => s.setVideoSegmentationModel)
28
+
29
+ const availableProviders = Object.keys(availableModelsForVideoSegmentation) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
31
+
32
+ return (
33
+ <MenubarSub>
34
+ <MenubarSubTrigger>
35
+ <Tag size="lg" color={TagColor.ZINC}>segmentation</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
+ </MenubarSubTrigger>
45
+ <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForVideoSegmentation[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
+ ))}
75
+ </MenubarSubContent>
76
+ </MenubarSub>
77
+ )
78
+ }
src/components/toolbars/top-menu/lists/VideoUpscalingModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,46 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForVideoUpscaling } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function VideoUpscalingModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForVideoUpscaling[provider] || []) : []
30
-
31
- if (models.length === 0) { return null }
32
 
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
- <Tag size="lg" color={TagColor.INDIGO}>upscale&nbsp;video</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {model}
57
- </MenubarCheckboxItem>
 
 
 
 
 
 
 
 
 
 
58
  ))}
59
  </MenubarSubContent>
60
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForVideoUpscaling } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function VideoUpscalingModelList() {
23
+
24
+ const provider = useSettings(s => s.videoUpscalingProvider)
25
+ const setProvider = useSettings(s => s.setVideoUpscalingProvider)
26
+ const model = useSettings(s => s.videoUpscalingModel)
27
+ const setModel = useSettings(s => s.setVideoUpscalingModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForVideoUpscaling) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
 
 
31
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
+ <Tag size="lg" color={TagColor.BLUE}>upscale&nbsp;video</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForVideoUpscaling[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/VoiceGenerationModelList.tsx CHANGED
@@ -2,10 +2,6 @@
2
 
3
  import {
4
  MenubarCheckboxItem,
5
- MenubarContent,
6
- MenubarItem,
7
- MenubarMenu,
8
- MenubarSeparator,
9
  MenubarSub,
10
  MenubarSubContent,
11
  MenubarSubTrigger,
@@ -15,46 +11,66 @@ import { TagColor } from "@/components/tags/types"
15
  import { Tag } from "@/components/tags/Tag"
16
  import { ComputeProvider } from "@/types"
17
  import { availableModelsForVoiceGeneration } from "@/components/settings/constants"
 
 
 
 
 
18
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
 
 
 
 
 
 
 
 
19
 
20
- export function VoiceGenerationModelList({
21
- provider,
22
- current,
23
- setter,
24
- }: {
25
- provider?: ComputeProvider
26
- current?: string
27
- setter: (model: string) => void
28
- }) {
29
- const models: string[] = provider ? (availableModelsForVoiceGeneration[provider] || []) : []
30
 
31
- if (models.length === 0) { return null }
32
-
33
  return (
34
  <MenubarSub>
35
  <MenubarSubTrigger>
36
  <Tag size="lg" color={TagColor.ORANGE}>generate&nbsp;voice</Tag>
37
- {current || "None"}
 
 
 
 
 
 
 
38
  </MenubarSubTrigger>
39
  <MenubarSubContent>
40
- {models.map(model => (
41
- <MenubarCheckboxItem
42
- key={model}
43
- checked={current === model}
44
- disabled={hasNoPublicAPI(model)}
45
- onClick={(e) => {
46
- if (hasNoPublicAPI(model)) {
47
- e.stopPropagation()
48
- e.preventDefault()
49
- return false
50
- }
51
- setter(model)
52
- e.stopPropagation()
53
- e.preventDefault()
54
- return false
55
- }}>
56
- {model}
57
- </MenubarCheckboxItem>
 
 
 
 
 
 
 
 
 
 
58
  ))}
59
  </MenubarSubContent>
60
  </MenubarSub>
 
2
 
3
  import {
4
  MenubarCheckboxItem,
 
 
 
 
5
  MenubarSub,
6
  MenubarSubContent,
7
  MenubarSubTrigger,
 
11
  import { Tag } from "@/components/tags/Tag"
12
  import { ComputeProvider } from "@/types"
13
  import { availableModelsForVoiceGeneration } from "@/components/settings/constants"
14
+ import { useSettings } from "@/controllers/settings"
15
+ import { ComputeProviderName } from "@/components/core/providers/ComputeProviderName"
16
+ import { ComputeProviderLogo } from "@/components/core/providers/ComputeProviderLogo"
17
+ import { cn } from "@/lib/utils"
18
+
19
  import { hasNoPublicAPI } from "./hasNoPublicAPI"
20
+ import { formatProvider } from "./formatProvider"
21
+
22
+ export function VoiceGenerationModelList() {
23
+
24
+ const provider = useSettings(s => s.voiceProvider)
25
+ const setProvider = useSettings(s => s.setVoiceProvider)
26
+ const model = useSettings(s => s.voiceGenerationModel)
27
+ const setModel = useSettings(s => s.setVoiceGenerationModel)
28
 
29
+ const availableProviders = Object.keys(availableModelsForVoiceGeneration) as ComputeProvider[]
30
+ if (!availableProviders) { return null }
 
 
 
 
 
 
 
 
31
 
 
 
32
  return (
33
  <MenubarSub>
34
  <MenubarSubTrigger>
35
  <Tag size="lg" color={TagColor.ORANGE}>generate&nbsp;voice</Tag>
36
+ <div className={cn(`flex flex-row space-x-2 items-center`)}>
37
+ <ComputeProviderLogo
38
+ provider={(provider && model) ? provider : undefined}
39
+ height={18}
40
+ className={cn(`rounded-full`)}
41
+ />
42
+ <div>{model || "None"}</div>
43
+ </div>
44
  </MenubarSubTrigger>
45
  <MenubarSubContent>
46
+ {availableProviders.map(p => (
47
+ <MenubarSub key={p}>
48
+ <MenubarSubTrigger>
49
+ <ComputeProviderName>{p}</ComputeProviderName>
50
+ </MenubarSubTrigger>
51
+ <MenubarSubContent>
52
+ {(availableModelsForVoiceGeneration[p] || []).map(m => (
53
+ <MenubarCheckboxItem
54
+ key={m}
55
+ checked={provider === p && model === m}
56
+ disabled={hasNoPublicAPI(m)}
57
+ onClick={(e) => {
58
+ if (hasNoPublicAPI(m)) {
59
+ e.stopPropagation()
60
+ e.preventDefault()
61
+ return false
62
+ }
63
+ setProvider(p)
64
+ setModel(m)
65
+ e.stopPropagation()
66
+ e.preventDefault()
67
+ return false
68
+ }}>
69
+ {m}
70
+ </MenubarCheckboxItem>
71
+ ))}
72
+ </MenubarSubContent>
73
+ </MenubarSub>
74
  ))}
75
  </MenubarSubContent>
76
  </MenubarSub>
src/components/toolbars/top-menu/lists/formatProvider.ts ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import { computeProviderShortNames } from "@/components/settings/constants"
2
+ import { ComputeProvider } from "@/types"
3
+
4
+ export function formatProvider(computeProvider?: ComputeProvider): string {
5
+ return `${
6
+ (computeProviderShortNames as any)[computeProvider || ""] || "None"
7
+ }`
8
+ }
src/components/toolbars/top-menu/music/index.tsx CHANGED
@@ -14,10 +14,8 @@ import {
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
17
- import { ProviderList } from "../lists/ProviderList"
18
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
19
- import { availableComputeProvidersForMusic } from "@/components/settings/constants"
20
- import { ComputeProvider, SettingsCategory } from "@/types"
21
  import { MusicGenerationModelList } from "../lists/MusicGenerationModelList"
22
  import { useResolver } from "@/controllers/resolver/useResolver"
23
  import { IsBusy } from "../IsBusy"
@@ -25,10 +23,6 @@ import { IsBusy } from "../IsBusy"
25
  export function TopMenuMusic() {
26
  const nbPendingRequestsForMusic = useResolver(s => s.nbPendingRequestsForMusic)
27
  const setShowSettings = useUI(s => s.setShowSettings)
28
- const musicProvider = useSettings(s => s.musicProvider)
29
- const setMusicProvider = useSettings(s => s.setMusicProvider)
30
- const musicGenerationModel = useSettings(s => s.musicGenerationModel)
31
- const setMusicGenerationModel = useSettings(s => s.setMusicGenerationModel)
32
  const musicRenderingStrategy = useSettings((s) => s.musicRenderingStrategy)
33
  const setMusicRenderingStrategy = useSettings((s) => s.setMusicRenderingStrategy)
34
 
@@ -39,12 +33,7 @@ export function TopMenuMusic() {
39
  <MenubarSub>
40
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.MUSIC) }}>Show advanced settings</MenubarItem>
41
  <MenubarSeparator />
42
- <MusicGenerationModelList provider={musicProvider} current={musicGenerationModel} setter={setMusicGenerationModel} />
43
- <ProviderList providers={availableComputeProvidersForMusic} current={musicProvider} setter={(newProvider: ComputeProvider) => {
44
- if (musicProvider === newProvider) { return }
45
- setMusicProvider(newProvider)
46
- setMusicGenerationModel(undefined)
47
- }} />
48
  <RenderingStrategyList current={musicRenderingStrategy} setter={setMusicRenderingStrategy} />
49
  <MenubarSeparator />
50
  <MenubarItem
 
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
 
17
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
18
+ import { SettingsCategory } from "@/types"
 
19
  import { MusicGenerationModelList } from "../lists/MusicGenerationModelList"
20
  import { useResolver } from "@/controllers/resolver/useResolver"
21
  import { IsBusy } from "../IsBusy"
 
23
  export function TopMenuMusic() {
24
  const nbPendingRequestsForMusic = useResolver(s => s.nbPendingRequestsForMusic)
25
  const setShowSettings = useUI(s => s.setShowSettings)
 
 
 
 
26
  const musicRenderingStrategy = useSettings((s) => s.musicRenderingStrategy)
27
  const setMusicRenderingStrategy = useSettings((s) => s.setMusicRenderingStrategy)
28
 
 
33
  <MenubarSub>
34
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.MUSIC) }}>Show advanced settings</MenubarItem>
35
  <MenubarSeparator />
36
+ <MusicGenerationModelList />
 
 
 
 
 
37
  <RenderingStrategyList current={musicRenderingStrategy} setter={setMusicRenderingStrategy} />
38
  <MenubarSeparator />
39
  <MenubarItem
src/components/toolbars/top-menu/sound/index.tsx CHANGED
@@ -14,10 +14,8 @@ import {
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
17
- import { ProviderList } from "../lists/ProviderList"
18
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
19
- import { availableComputeProvidersForSound } from "@/components/settings/constants"
20
- import { ComputeProvider, SettingsCategory } from "@/types"
21
  import { SoundGenerationModelList } from "../lists/SoundGenerationModelList"
22
  import { useResolver } from "@/controllers/resolver/useResolver"
23
  import { IsBusy } from "../IsBusy"
@@ -25,10 +23,6 @@ import { IsBusy } from "../IsBusy"
25
  export function TopMenuSound() {
26
  const nbPendingRequestsForSound = useResolver(s => s.nbPendingRequestsForSound)
27
  const setShowSettings = useUI(s => s.setShowSettings)
28
- const soundProvider = useSettings(s => s.soundProvider)
29
- const setSoundProvider = useSettings(s => s.setSoundProvider)
30
- const soundGenerationModel = useSettings(s => s.soundGenerationModel)
31
- const setSoundGenerationModel = useSettings(s => s.setSoundGenerationModel)
32
  const soundRenderingStrategy = useSettings((s) => s.soundRenderingStrategy)
33
  const setSoundRenderingStrategy = useSettings((s) => s.setSoundRenderingStrategy)
34
  return (
@@ -38,12 +32,7 @@ export function TopMenuSound() {
38
  <MenubarSub>
39
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.SOUND) }}>Show advanced settings</MenubarItem>
40
  <MenubarSeparator />
41
- <SoundGenerationModelList provider={soundProvider} current={soundGenerationModel} setter={setSoundGenerationModel} />
42
- <ProviderList providers={availableComputeProvidersForSound} current={soundProvider} setter={(newProvider: ComputeProvider) => {
43
- if (soundProvider === newProvider) { return }
44
- setSoundProvider(newProvider)
45
- setSoundGenerationModel(undefined)
46
- }} />
47
  <RenderingStrategyList current={soundRenderingStrategy} setter={setSoundRenderingStrategy} />
48
  <MenubarSeparator />
49
  <MenubarItem
 
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
 
17
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
18
+ import { SettingsCategory } from "@/types"
 
19
  import { SoundGenerationModelList } from "../lists/SoundGenerationModelList"
20
  import { useResolver } from "@/controllers/resolver/useResolver"
21
  import { IsBusy } from "../IsBusy"
 
23
  export function TopMenuSound() {
24
  const nbPendingRequestsForSound = useResolver(s => s.nbPendingRequestsForSound)
25
  const setShowSettings = useUI(s => s.setShowSettings)
 
 
 
 
26
  const soundRenderingStrategy = useSettings((s) => s.soundRenderingStrategy)
27
  const setSoundRenderingStrategy = useSettings((s) => s.setSoundRenderingStrategy)
28
  return (
 
32
  <MenubarSub>
33
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.SOUND) }}>Show advanced settings</MenubarItem>
34
  <MenubarSeparator />
35
+ <SoundGenerationModelList />
 
 
 
 
 
36
  <RenderingStrategyList current={soundRenderingStrategy} setter={setSoundRenderingStrategy} />
37
  <MenubarSeparator />
38
  <MenubarItem
src/components/toolbars/top-menu/video/index.tsx CHANGED
@@ -14,26 +14,22 @@ import {
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
17
- import { ProviderList } from "../lists/ProviderList"
18
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
19
- import { availableComputeProvidersForVideos } from "@/components/settings/constants"
20
  import { VideoGenerationModelList } from "../lists/VideoGenerationModelList"
21
  import { VideoUpscalingModelList } from "../lists/VideoUpscalingModelList"
22
- import { ComputeProvider, SettingsCategory } from "@/types"
23
  import { useResolver } from "@/controllers/resolver/useResolver"
24
  import { IsBusy } from "../IsBusy"
 
 
25
 
26
  export function TopMenuVideo() {
27
  const nbPendingRequestsForVideo = useResolver(s => s.nbPendingRequestsForVideo)
28
  const setShowSettings = useUI(s => s.setShowSettings)
29
- const videoProvider = useSettings(s => s.videoProvider)
30
- const setVideoProvider = useSettings(s => s.setVideoProvider)
31
- const videoGenerationModel = useSettings(s => s.videoGenerationModel)
32
- const setVideoGenerationModel = useSettings(s => s.setVideoGenerationModel)
33
- const videoUpscalingModel = useSettings(s => s.videoUpscalingModel)
34
- const setVideoUpscalingModel = useSettings(s => s.setVideoUpscalingModel)
35
  const videoRenderingStrategy = useSettings((s) => s.videoRenderingStrategy)
36
  const setVideoRenderingStrategy = useSettings((s) => s.setVideoRenderingStrategy)
 
37
  return (
38
  <MenubarMenu>
39
  <MenubarTrigger><span>Video</span><IsBusy nbPendingTasks={nbPendingRequestsForVideo} /></MenubarTrigger>
@@ -41,14 +37,10 @@ export function TopMenuVideo() {
41
  <MenubarSub>
42
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.VIDEO) }}>Show advanced settings</MenubarItem>
43
  <MenubarSeparator />
44
- <VideoGenerationModelList provider={videoProvider} current={videoGenerationModel} setter={setVideoGenerationModel} />
45
- <VideoUpscalingModelList provider={videoProvider} current={videoUpscalingModel} setter={setVideoUpscalingModel} />
46
- <ProviderList providers={availableComputeProvidersForVideos} current={videoProvider} setter={(newProvider: ComputeProvider) => {
47
- if (videoProvider === newProvider) { return }
48
- setVideoProvider(newProvider)
49
- setVideoGenerationModel(undefined)
50
- setVideoUpscalingModel(undefined)
51
- }} />
52
  <RenderingStrategyList current={videoRenderingStrategy} setter={setVideoRenderingStrategy} />
53
  <MenubarSeparator />
54
  <MenubarItem
 
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
 
17
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
 
18
  import { VideoGenerationModelList } from "../lists/VideoGenerationModelList"
19
  import { VideoUpscalingModelList } from "../lists/VideoUpscalingModelList"
20
+ import { SettingsCategory } from "@/types"
21
  import { useResolver } from "@/controllers/resolver/useResolver"
22
  import { IsBusy } from "../IsBusy"
23
+ import { VideoDepthModelList } from "../lists/VideoDepthModelList"
24
+ import { VideoSegmentationModelList } from "../lists/VideoSegmentationModelList"
25
 
26
  export function TopMenuVideo() {
27
  const nbPendingRequestsForVideo = useResolver(s => s.nbPendingRequestsForVideo)
28
  const setShowSettings = useUI(s => s.setShowSettings)
29
+
 
 
 
 
 
30
  const videoRenderingStrategy = useSettings((s) => s.videoRenderingStrategy)
31
  const setVideoRenderingStrategy = useSettings((s) => s.setVideoRenderingStrategy)
32
+
33
  return (
34
  <MenubarMenu>
35
  <MenubarTrigger><span>Video</span><IsBusy nbPendingTasks={nbPendingRequestsForVideo} /></MenubarTrigger>
 
37
  <MenubarSub>
38
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.VIDEO) }}>Show advanced settings</MenubarItem>
39
  <MenubarSeparator />
40
+ <VideoGenerationModelList />
41
+ <VideoUpscalingModelList />
42
+ <VideoDepthModelList />
43
+ <VideoSegmentationModelList />
 
 
 
 
44
  <RenderingStrategyList current={videoRenderingStrategy} setter={setVideoRenderingStrategy} />
45
  <MenubarSeparator />
46
  <MenubarItem
src/components/toolbars/top-menu/voice/index.tsx CHANGED
@@ -14,21 +14,16 @@ import {
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
17
- import { ProviderList } from "../lists/ProviderList"
18
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
19
- import { availableComputeProvidersForVoice } from "@/components/settings/constants"
20
  import { VoiceGenerationModelList } from "../lists/VoiceGenerationModelList"
21
- import { ComputeProvider, SettingsCategory } from "@/types"
22
  import { useResolver } from "@/controllers/resolver/useResolver"
23
  import { IsBusy } from "../IsBusy"
24
 
25
  export function TopMenuVoice() {
26
  const nbPendingRequestsForVoice = useResolver(s => s.nbPendingRequestsForVoice)
27
  const setShowSettings = useUI(s => s.setShowSettings)
28
- const voiceProvider = useSettings(s => s.voiceProvider)
29
- const setVoiceProvider = useSettings(s => s.setVoiceProvider)
30
- const voiceGenerationModel = useSettings(s => s.voiceGenerationModel)
31
- const setVoiceGenerationModel = useSettings(s => s.setVoiceGenerationModel)
32
  const voiceRenderingStrategy = useSettings((s) => s.voiceRenderingStrategy)
33
  const setVoiceRenderingStrategy = useSettings((s) => s.setVoiceRenderingStrategy)
34
  return (
@@ -38,12 +33,7 @@ export function TopMenuVoice() {
38
  <MenubarSub>
39
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.VOICE) }}>Show advanced settings</MenubarItem>
40
  <MenubarSeparator />
41
- <VoiceGenerationModelList provider={voiceProvider} current={voiceGenerationModel} setter={setVoiceGenerationModel} />
42
- <ProviderList providers={availableComputeProvidersForVoice} current={voiceProvider} setter={(newProvider: ComputeProvider) => {
43
- if (voiceProvider === newProvider) { return }
44
- setVoiceProvider(newProvider)
45
- setVoiceGenerationModel(undefined)
46
- }} />
47
  <RenderingStrategyList current={voiceRenderingStrategy} setter={setVoiceRenderingStrategy} />
48
  <MenubarSeparator />
49
  <MenubarItem
 
14
  import { useSettings } from "@/controllers/settings"
15
  import { useUI } from "@/controllers/ui"
16
 
17
+
18
  import { RenderingStrategyList } from "../lists/RenderingStrategyList"
 
19
  import { VoiceGenerationModelList } from "../lists/VoiceGenerationModelList"
20
+ import { SettingsCategory } from "@/types"
21
  import { useResolver } from "@/controllers/resolver/useResolver"
22
  import { IsBusy } from "../IsBusy"
23
 
24
  export function TopMenuVoice() {
25
  const nbPendingRequestsForVoice = useResolver(s => s.nbPendingRequestsForVoice)
26
  const setShowSettings = useUI(s => s.setShowSettings)
 
 
 
 
27
  const voiceRenderingStrategy = useSettings((s) => s.voiceRenderingStrategy)
28
  const setVoiceRenderingStrategy = useSettings((s) => s.setVoiceRenderingStrategy)
29
  return (
 
33
  <MenubarSub>
34
  <MenubarItem onClick={() => { setShowSettings(SettingsCategory.VOICE) }}>Show advanced settings</MenubarItem>
35
  <MenubarSeparator />
36
+ <VoiceGenerationModelList />
 
 
 
 
 
37
  <RenderingStrategyList current={voiceRenderingStrategy} setter={setVoiceRenderingStrategy} />
38
  <MenubarSeparator />
39
  <MenubarItem