Skip to content

Commit d5e3629

Browse files
committed
fix style
1 parent 98624dd commit d5e3629

File tree

10 files changed

+3643
-3627
lines changed

10 files changed

+3643
-3627
lines changed

examples/research_projects/geodiff/geodiff_molecule_conformation.ipynb

Lines changed: 3619 additions & 3611 deletions
Large diffs are not rendered by default.

examples/research_projects/gligen/demo.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"%load_ext autoreload\n",
2727
"%autoreload 2\n",
2828
"\n",
29-
"import torch\n",
30-
"from diffusers import StableDiffusionGLIGENTextImagePipeline, StableDiffusionGLIGENPipeline"
29+
"from diffusers import StableDiffusionGLIGENPipeline"
3130
]
3231
},
3332
{
@@ -36,16 +35,17 @@
3635
"metadata": {},
3736
"outputs": [],
3837
"source": [
39-
"import os\n",
38+
"from transformers import CLIPTextModel, CLIPTokenizer\n",
39+
"\n",
4040
"import diffusers\n",
4141
"from diffusers import (\n",
4242
" AutoencoderKL,\n",
4343
" DDPMScheduler,\n",
44-
" UNet2DConditionModel,\n",
45-
" UniPCMultistepScheduler,\n",
4644
" EulerDiscreteScheduler,\n",
45+
" UNet2DConditionModel,\n",
4746
")\n",
48-
"from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer\n",
47+
"\n",
48+
"\n",
4949
"# pretrained_model_name_or_path = 'masterful/gligen-1-4-generation-text-box'\n",
5050
"\n",
5151
"pretrained_model_name_or_path = '/root/data/zhizhonghuang/checkpoints/models--masterful--gligen-1-4-generation-text-box/snapshots/d2820dc1e9ba6ca082051ce79cfd3eb468ae2c83'\n",
@@ -122,6 +122,7 @@
122122
"\n",
123123
"import numpy as np\n",
124124
"\n",
125+
"\n",
125126
"boxes = np.array([x[1] for x in gen_boxes])\n",
126127
"boxes = boxes / 512\n",
127128
"boxes[:, 2] = boxes[:, 0] + boxes[:, 2]\n",

tests/models/test_modeling_common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@
5757
get_python_version,
5858
is_torch_compile,
5959
require_torch_2,
60-
require_torch_accelerator_with_training,
61-
require_torch_gpu,
6260
require_torch_accelerator,
61+
require_torch_accelerator_with_training,
6362
require_torch_multi_gpu,
6463
run_test_in_subprocess,
6564
torch_all_close,

tests/pipelines/animatediff/test_animatediff.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from diffusers.utils.testing_utils import (
2323
numpy_cosine_similarity_distance,
2424
require_accelerator,
25-
require_torch_gpu,
2625
require_torch_accelerator,
2726
slow,
2827
torch_device,

tests/pipelines/cogvideo/test_cogvideox_image2video.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from diffusers.utils.testing_utils import (
2727
enable_full_determinism,
2828
numpy_cosine_similarity_distance,
29-
require_torch_gpu,
3029
require_torch_accelerator,
3130
slow,
3231
torch_device,

tests/pipelines/controlnet/test_controlnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
load_image,
4141
load_numpy,
4242
require_torch_2,
43-
require_torch_gpu,
4443
require_torch_accelerator,
44+
require_torch_gpu,
4545
run_test_in_subprocess,
4646
slow,
4747
torch_device,
@@ -964,7 +964,7 @@ def test_sequential_cpu_offloading(self):
964964
num_inference_steps=2,
965965
output_type="np",
966966
)
967-
967+
968968
if torch_device == "cuda":
969969
mem_bytes = torch.cuda.max_memory_allocated()
970970
elif torch_device == "xpu":

tests/pipelines/controlnet/test_controlnet_sdxl_img2img.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
UNet2DConditionModel,
2929
)
3030
from diffusers.utils.import_utils import is_xformers_available
31-
from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, require_torch_accelerator, torch_device
31+
from diffusers.utils.testing_utils import (
32+
enable_full_determinism,
33+
floats_tensor,
34+
require_torch_accelerator,
35+
torch_device,
36+
)
3237

3338
from ..pipeline_params import (
3439
IMAGE_TO_IMAGE_IMAGE_PARAMS,

tests/pipelines/controlnet_xs/test_controlnetxs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
load_numpy,
4141
require_accelerator,
4242
require_torch_2,
43-
require_torch_gpu,
4443
require_torch_accelerator,
4544
run_test_in_subprocess,
4645
slow,

tests/pipelines/controlnet_xs/test_controlnetxs_sdxl.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@
3131
UNet2DConditionModel,
3232
)
3333
from diffusers.utils.import_utils import is_xformers_available
34-
from diffusers.utils.testing_utils import enable_full_determinism, load_image, require_torch_accelerator, slow, torch_device
34+
from diffusers.utils.testing_utils import (
35+
enable_full_determinism,
36+
load_image,
37+
require_torch_accelerator,
38+
slow,
39+
torch_device,
40+
)
3541
from diffusers.utils.torch_utils import randn_tensor
3642

3743
from ...models.autoencoders.vae import (

tests/pipelines/deepfloyd_if/test_if_img2img_superresolution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_if_img2img_superresolution(self):
124124
)
125125
pipe.unet.set_attn_processor(AttnAddedKVProcessor())
126126
pipe.enable_model_cpu_offload(device=torch_device)
127-
127+
128128
if torch_device == "cuda":
129129
torch.cuda.reset_max_memory_allocated()
130130
torch.cuda.empty_cache()

0 commit comments

Comments
 (0)