2023-05-16 17:32:53 +00:00
|
|
|
//go:build stablediffusion
|
|
|
|
// +build stablediffusion
|
|
|
|
|
|
|
|
package stablediffusion
|
|
|
|
|
|
|
|
import (
|
|
|
|
stableDiffusion "github.com/mudler/go-stable-diffusion"
|
|
|
|
)
|
|
|
|
|
|
|
|
func GenerateImage(height, width, mode, step, seed int, positive_prompt, negative_prompt, dst, asset_dir string) error {
|
2023-06-05 15:21:38 +00:00
|
|
|
if height > 512 || width > 512 {
|
|
|
|
return stableDiffusion.GenerateImageUpscaled(
|
|
|
|
height,
|
|
|
|
width,
|
|
|
|
step,
|
|
|
|
seed,
|
|
|
|
positive_prompt,
|
|
|
|
negative_prompt,
|
|
|
|
dst,
|
|
|
|
asset_dir,
|
|
|
|
)
|
|
|
|
}
|
2023-05-16 17:32:53 +00:00
|
|
|
return stableDiffusion.GenerateImage(
|
|
|
|
height,
|
|
|
|
width,
|
|
|
|
mode,
|
|
|
|
step,
|
|
|
|
seed,
|
|
|
|
positive_prompt,
|
|
|
|
negative_prompt,
|
|
|
|
dst,
|
|
|
|
"",
|
|
|
|
asset_dir,
|
|
|
|
)
|
|
|
|
}
|