Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fengzch-das
nunchaku
Commits
57e50f8d
Unverified
Commit
57e50f8d
authored
May 01, 2025
by
Muyang Li
Committed by
GitHub
May 01, 2025
Browse files
style: upgrade the linter (#339)
* style: reformated codes * style: reformated codes
parent
b737368d
Changes
174
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
15 additions
and
5 deletions
+15
-5
tests/README.md
tests/README.md
+2
-2
tests/data/__init__.py
tests/data/__init__.py
+0
-1
tests/flux/test_flux_cache.py
tests/flux/test_flux_cache.py
+1
-0
tests/flux/test_flux_dev.py
tests/flux/test_flux_dev.py
+1
-0
tests/flux/test_flux_dev_loras.py
tests/flux/test_flux_dev_loras.py
+1
-0
tests/flux/test_flux_double_fb_cache.py
tests/flux/test_flux_double_fb_cache.py
+2
-1
tests/flux/test_flux_schnell.py
tests/flux/test_flux_schnell.py
+1
-0
tests/flux/test_flux_teacache.py
tests/flux/test_flux_teacache.py
+1
-0
tests/flux/test_flux_tools.py
tests/flux/test_flux_tools.py
+1
-0
tests/flux/test_multiple_batch.py
tests/flux/test_multiple_batch.py
+1
-0
tests/flux/test_shuttle_jaguar.py
tests/flux/test_shuttle_jaguar.py
+1
-0
tests/flux/test_turing.py
tests/flux/test_turing.py
+1
-0
tests/flux/utils.py
tests/flux/utils.py
+1
-0
tests/requirements.txt
tests/requirements.txt
+1
-1
No files found.
tests/README.md
View file @
57e50f8d
...
@@ -35,7 +35,7 @@ To test visual output correctness, you can:
...
@@ -35,7 +35,7 @@ To test visual output correctness, you can:
lpips
=
compute_lpips
(
dir1, dir2
)
lpips
=
compute_lpips
(
dir1, dir2
)
```
```
Here,
`dir1`
should point to the directory containing the reference images, and
`dir2`
should contain the images generated by your method.
Here,
`dir1`
should point to the directory containing the reference images, and
`dir2`
should contain the images generated by your method.
### Setting the LPIPS Threshold
### Setting the LPIPS Threshold
...
@@ -43,4 +43,4 @@ To pass the test, the LPIPS score must be below a predefined threshold—typical
...
@@ -43,4 +43,4 @@ To pass the test, the LPIPS score must be below a predefined threshold—typical
## Acknowledgments
## Acknowledgments
This contribution guide is adapted from
[
SGLang
](
https://github.com/sgl-project/sglang/tree/main/test
)
. We thank them for the inspiration.
This contribution guide is adapted from
[
SGLang
](
https://github.com/sgl-project/sglang/tree/main/test
)
. We thank them for the inspiration.
\ No newline at end of file
tests/data/__init__.py
View file @
57e50f8d
...
@@ -3,7 +3,6 @@ import random
...
@@ -3,7 +3,6 @@ import random
import
datasets
import
datasets
import
yaml
import
yaml
from
huggingface_hub
import
snapshot_download
from
nunchaku.utils
import
fetch_or_download
from
nunchaku.utils
import
fetch_or_download
...
...
tests/flux/test_flux_cache.py
View file @
57e50f8d
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/test_flux_dev.py
View file @
57e50f8d
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/test_flux_dev_loras.py
View file @
57e50f8d
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/test_flux_double_fb_cache.py
View file @
57e50f8d
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
@@ -9,7 +10,7 @@ from .utils import run_test
...
@@ -9,7 +10,7 @@ from .utils import run_test
"use_double_fb_cache,residual_diff_threshold_multi,residual_diff_threshold_single,height,width,num_inference_steps,lora_name,lora_strength,expected_lpips"
,
"use_double_fb_cache,residual_diff_threshold_multi,residual_diff_threshold_single,height,width,num_inference_steps,lora_name,lora_strength,expected_lpips"
,
[
[
(
True
,
0.09
,
0.12
,
1024
,
1024
,
30
,
None
,
1
,
0.24
if
get_precision
()
==
"int4"
else
0.165
),
(
True
,
0.09
,
0.12
,
1024
,
1024
,
30
,
None
,
1
,
0.24
if
get_precision
()
==
"int4"
else
0.165
),
(
True
,
0.09
,
0.12
,
1024
,
1024
,
50
,
None
,
1
,
0.24
if
get_precision
()
==
"int4"
else
0.1
44
),
(
True
,
0.09
,
0.12
,
1024
,
1024
,
50
,
None
,
1
,
0.24
if
get_precision
()
==
"int4"
else
0.1
61
),
],
],
)
)
def
test_flux_dev_double_fb_cache
(
def
test_flux_dev_double_fb_cache
(
...
...
tests/flux/test_flux_schnell.py
View file @
57e50f8d
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/test_flux_teacache.py
View file @
57e50f8d
...
@@ -8,6 +8,7 @@ from diffusers.pipelines.flux.pipeline_flux import FluxPipeline
...
@@ -8,6 +8,7 @@ from diffusers.pipelines.flux.pipeline_flux import FluxPipeline
from
nunchaku
import
NunchakuFluxTransformer2dModel
from
nunchaku
import
NunchakuFluxTransformer2dModel
from
nunchaku.caching.teacache
import
TeaCache
from
nunchaku.caching.teacache
import
TeaCache
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
already_generate
,
compute_lpips
,
offload_pipeline
from
.utils
import
already_generate
,
compute_lpips
,
offload_pipeline
...
...
tests/flux/test_flux_tools.py
View file @
57e50f8d
...
@@ -2,6 +2,7 @@ import pytest
...
@@ -2,6 +2,7 @@ import pytest
import
torch
import
torch
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/test_multiple_batch.py
View file @
57e50f8d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/test_shuttle_jaguar.py
View file @
57e50f8d
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/test_turing.py
View file @
57e50f8d
import
pytest
import
pytest
from
nunchaku.utils
import
get_precision
,
is_turing
from
nunchaku.utils
import
get_precision
,
is_turing
from
.utils
import
run_test
from
.utils
import
run_test
...
...
tests/flux/utils.py
View file @
57e50f8d
...
@@ -14,6 +14,7 @@ import nunchaku
...
@@ -14,6 +14,7 @@ import nunchaku
from
nunchaku
import
NunchakuFluxTransformer2dModel
,
NunchakuT5EncoderModel
from
nunchaku
import
NunchakuFluxTransformer2dModel
,
NunchakuT5EncoderModel
from
nunchaku.caching.diffusers_adapters
import
apply_cache_on_pipe
from
nunchaku.caching.diffusers_adapters
import
apply_cache_on_pipe
from
nunchaku.lora.flux.compose
import
compose_lora
from
nunchaku.lora.flux.compose
import
compose_lora
from
..data
import
get_dataset
from
..data
import
get_dataset
from
..utils
import
already_generate
,
compute_lpips
,
hash_str_to_int
from
..utils
import
already_generate
,
compute_lpips
,
hash_str_to_int
...
...
tests/requirements.txt
View file @
57e50f8d
...
@@ -9,4 +9,4 @@ git+https://github.com/asomoza/image_gen_aux.git
...
@@ -9,4 +9,4 @@ git+https://github.com/asomoza/image_gen_aux.git
insightface
insightface
opencv-python
opencv-python
facexlib
facexlib
onnxruntime
onnxruntime
\ No newline at end of file
Prev
1
…
5
6
7
8
9
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment