-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfile_estimate__stablediffusioncpp_test.go
94 lines (90 loc) · 1.8 KB
/
file_estimate__stablediffusioncpp_test.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package gguf_parser
import (
"context"
"testing"
"github.com/davecgh/go-spew/spew"
)
func TestGGUFFile_EstimateStableDiffusionRun(t *testing.T) {
ctx := context.Background()
cases := []struct {
name string
given *GGUFFile
}{
{
name: "sd 1.5",
given: func() *GGUFFile {
f, err := ParseGGUFFileFromHuggingFace(
ctx,
"gpustack/stable-diffusion-v1-5-GGUF",
"stable-diffusion-v1-5-FP16.gguf",
SkipLargeMetadata())
if err != nil {
t.Fatal(err)
}
return f
}(),
},
{
name: "sd 2.1",
given: func() *GGUFFile {
f, err := ParseGGUFFileFromHuggingFace(
ctx,
"gpustack/stable-diffusion-v2-1-GGUF",
"stable-diffusion-v2-1-Q8_0.gguf",
SkipLargeMetadata())
if err != nil {
t.Fatal(err)
}
return f
}(),
},
{
name: "sd xl",
given: func() *GGUFFile {
f, err := ParseGGUFFileFromHuggingFace(
ctx,
"gpustack/stable-diffusion-xl-base-1.0-GGUF",
"stable-diffusion-xl-base-1.0-FP16.gguf",
SkipLargeMetadata())
if err != nil {
t.Fatal(err)
}
return f
}(),
},
{
name: "sd 3.5 large",
given: func() *GGUFFile {
f, err := ParseGGUFFileFromHuggingFace(
ctx,
"gpustack/stable-diffusion-v3-5-large-GGUF",
"stable-diffusion-v3-5-large-Q4_0.gguf",
SkipLargeMetadata())
if err != nil {
t.Fatal(err)
}
return f
}(),
},
{
name: "flux .1 dev",
given: func() *GGUFFile {
f, err := ParseGGUFFileFromHuggingFace(
ctx,
"gpustack/FLUX.1-dev-GGUF",
"FLUX.1-dev-Q4_0.gguf",
SkipLargeMetadata())
if err != nil {
t.Fatal(err)
}
return f
}(),
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
f := tc.given
t.Log("\n", spew.Sdump(f.EstimateStableDiffusionCppRun()), "\n")
})
}
}