refactor stable diffusion service, use api key instead of configs

This commit is contained in:
RockYang
2024-08-07 17:30:59 +08:00
parent 6a8b4ee2f1
commit 1d0006ce59
7 changed files with 139 additions and 262 deletions

View File

@@ -199,13 +199,11 @@ func main() {
}),
// Stable Diffusion 机器人
fx.Provide(sd.NewServicePool),
fx.Invoke(func(pool *sd.ServicePool, config *types.AppConfig) {
pool.InitServices(config.SdConfigs)
if pool.HasAvailableService() {
pool.CheckTaskNotify()
pool.CheckTaskStatus()
}
fx.Provide(sd.NewService),
fx.Invoke(func(s *sd.Service, config *types.AppConfig) {
s.Run()
s.CheckTaskStatus()
s.CheckTaskNotify()
}),
fx.Provide(suno.NewService),