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 f9b809801d
commit c9d0700fd9
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),