-
Notifications
You must be signed in to change notification settings - Fork 6
/
webui.go
37 lines (30 loc) · 865 Bytes
/
webui.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* @Author: SpenserCai
* @Date: 2023-08-11 13:15:25
* @version:
* @LastEditors: SpenserCai
* @LastEditTime: 2023-09-01 13:15:08
* @Description: file content
*/
package webui
import (
"time"
rclient "github.com/go-openapi/runtime/client"
StableDiffClient "github.com/SpenserCai/sd-webui-go/stablediffusion/client"
"github.com/go-openapi/strfmt"
)
type StableDiffInterface struct {
Client *StableDiffClient.StableDiffusion
}
func NewStableDiffInterface(host string) *StableDiffInterface {
rclient.DefaultTimeout = 600 * time.Second
var client *StableDiffClient.StableDiffusion
if host == "" {
client = StableDiffClient.NewHTTPClient(strfmt.Default)
} else {
client = StableDiffClient.NewHTTPClientWithConfig(strfmt.Default, StableDiffClient.DefaultTransportConfig().WithHost(host))
}
return &StableDiffInterface{
Client: client,
}
}