mirror of
https://github.com/GayPizzaSpecifications/stable-diffusion-rpc.git
synced 2025-08-03 05:30:54 +00:00
Add command-line options for bind host and port.
This commit is contained in:
@ -9,6 +9,12 @@ struct ServerCommand: ParsableCommand {
|
||||
@Option(name: .shortAndLong, help: "Path to models directory")
|
||||
var modelsDirectoryPath: String = "models"
|
||||
|
||||
@Option(name: .long, help: "Bind host")
|
||||
var bindHost: String = "0.0.0.0"
|
||||
|
||||
@Option(name: .long, help: "Bind port")
|
||||
var bindPort: Int = 4546
|
||||
|
||||
mutating func run() throws {
|
||||
let modelsDirectoryURL = URL(filePath: modelsDirectoryPath)
|
||||
let modelManager = ModelManager(modelBaseURL: modelsDirectoryURL)
|
||||
@ -30,7 +36,7 @@ struct ServerCommand: ParsableCommand {
|
||||
ModelServiceProvider(modelManager: modelManager),
|
||||
ImageGenerationServiceProvider(modelManager: modelManager)
|
||||
])
|
||||
.bind(host: "0.0.0.0", port: 4546)
|
||||
.bind(host: bindHost, port: bindPort)
|
||||
|
||||
dispatchMain()
|
||||
}
|
||||
|
Reference in New Issue
Block a user