Formatting, linting, and hopefully a CI build.

This commit is contained in:
2023-04-22 15:43:22 -07:00
parent 2759c8d7fb
commit 4bf5ceefbe
13 changed files with 117 additions and 68 deletions

View File

@ -1,17 +1,18 @@
import Foundation
import ArgumentParser
import Foundation
import GRPC
import NIO
import StableDiffusionCore
import System
struct ServerCommand: ParsableCommand {
@Option(name: .shortAndLong, help: "Path to models directory")
var modelsDirectoryPath: String = "models"
mutating func run() throws {
let modelsDirectoryURL = URL(filePath: modelsDirectoryPath)
let modelManager = ModelManager(modelBaseURL: modelsDirectoryURL)
let semaphore = DispatchSemaphore(value: 0)
Task {
print("Loading initial models...")
@ -32,9 +33,9 @@ struct ServerCommand: ParsableCommand {
ImageGenerationServiceProvider(modelManager: modelManager)
])
.bind(host: "0.0.0.0", port: 4546)
dispatchMain()
}
}
ServerCommand.main()