Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hugefiver committed Feb 25, 2023
1 parent a90dd38 commit 2d5b22b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sd/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ func (c *StableDiffusionConfig) SetValueByKey(key string, value string) error {
func (c *StableDiffusionConfig) GetServer() string {
server := c.Server
if server == "" {
return orm.GetSDDefaultServer()
server = orm.GetSDDefaultServer()
}
server = strings.TrimSuffix(server, "/")
return server
}

Expand Down
2 changes: 1 addition & 1 deletion sd/sd.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func requestStableDiffusion(addr string, req *StableDiffusionReq) (*StableDiffus

ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
defer cancel()
httpReq, err := http.NewRequest("POST", addr, bytes.NewReader(bs))
httpReq, err := http.NewRequest("POST", addr+"/sdapi/v1/txt2img", bytes.NewReader(bs))
if err != nil {
log.Error("create stable diffusion request failed", zap.Error(err))
return nil, err
Expand Down

0 comments on commit 2d5b22b

Please sign in to comment.