手動上傳圖片文件
This commit is contained in:
		@@ -18,9 +18,14 @@ import (
 | 
			
		||||
type Image struct {
 | 
			
		||||
	ID                int       `json:"id" gorm:"primary_key"`
 | 
			
		||||
	Name              string    `json:"name"`
 | 
			
		||||
	Hash              string    `json:"hash"`
 | 
			
		||||
	Path              string    `json:"path"`
 | 
			
		||||
	Type              string    `json:"type"`
 | 
			
		||||
	Size              int       `json:"size"`
 | 
			
		||||
	Width             int       `json:"width"`
 | 
			
		||||
	Height            int       `json:"height"`
 | 
			
		||||
	Prompt            string    `json:"prompt"`
 | 
			
		||||
	Format            string    `json:"format"`
 | 
			
		||||
	NegativePrompt    string    `json:"negative_prompt"`
 | 
			
		||||
	NumInferenceSteps int       `json:"num_inference_steps"` // Number of inference steps (minimum: 1; maximum: 500)
 | 
			
		||||
	GuidanceScale     float32   `json:"guidance_scale"`      // Scale for classifier-free guidance (minimum: 1; maximum: 20)
 | 
			
		||||
@@ -44,7 +49,6 @@ func (img *Image) ToWebP(width int, height int, fit string) ([]byte, error) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 如果原图是GIF格式的动态图片,直接不作尺寸处理,直接转换为webp格式
 | 
			
		||||
	if format == "gif" {
 | 
			
		||||
		converter := giftowebp.NewConverter()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user