jbilcke-hf / clapper

Clapper.app, a video synthesizer and sequencer designed for the age of AI cinema
https://clapper.app
GNU General Public License v3.0
2.08k stars 195 forks source link

How to add My own ComputeProvider, #33

Closed zhanghongyong123456 closed 2 months ago

zhanghongyong123456 commented 3 months ago

when i use
extend-compute-provider.tx

import { ComputeProvider } from '@aitube/clapper-services'

declare module '@aitube/clapper-services' { export enum ComputeProvider { MyComputeProvider = 'xiaosi', } }

console.log('打印扩展是否生效', ComputeProvider.MyComputeProvider)

in main.tsx test: import '@/store/extend-compute-provider' import('@aitube/clapper-services') .then((module) => { console.log(module); // 输出整个模块对象 console.log(module.ComputeProvider); // output ComputeProvider console.log(module.ComputeProvider?.MyComputeProvider, '模块导入成功'); / }) .catch((error) => { console.error('模块导入失败:', error); });

output is undefined
What should I do

jbilcke-hf commented 3 months ago

Hi, I'm not sure about this specific syntax and way of extending an enum,

but if you would like to add a new public ComputeProvider that could benefit everyon (eg. a public cloud API service provider, or an open-source platform that we can run locally) let me know and I will add it

if this is regarding ComfyUI, I have added a new provider for this (ComputeProvider.COMFYUI)