Skip to content

Commit 14b34fa

Browse files
authored
Merge branch 'main' into main
2 parents 7c1fca0 + a26d570 commit 14b34fa

16 files changed

+18
-42
lines changed

docs/source/en/api/pipelines/sana.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ Refer to the [Quantization](../../quantization/overview) overview to learn more
5959
```py
6060
import torch
6161
from diffusers import BitsAndBytesConfig as DiffusersBitsAndBytesConfig, SanaTransformer2DModel, SanaPipeline
62-
from transformers import BitsAndBytesConfig as BitsAndBytesConfig, AutoModelForCausalLM
62+
from transformers import BitsAndBytesConfig as BitsAndBytesConfig, AutoModel
6363

6464
quant_config = BitsAndBytesConfig(load_in_8bit=True)
65-
text_encoder_8bit = AutoModelForCausalLM.from_pretrained(
65+
text_encoder_8bit = AutoModel.from_pretrained(
6666
"Efficient-Large-Model/Sana_1600M_1024px_diffusers",
6767
subfolder="text_encoder",
6868
quantization_config=quant_config,

tests/models/transformers/test_models_prior.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def test_output_pretrained(self):
132132
output = model(**input)[0]
133133

134134
output_slice = output[0, :5].flatten().cpu()
135-
print(output_slice)
136135

137136
# Since the VAE Gaussian prior's generator is seeded on the appropriate device,
138137
# the expected output slices are not the same for CPU and GPU.
@@ -182,7 +181,6 @@ def test_kandinsky_prior(self, seed, expected_slice):
182181
assert list(sample.shape) == [1, 768]
183182

184183
output_slice = sample[0, :8].flatten().cpu()
185-
print(output_slice)
186184
expected_output_slice = torch.tensor(expected_slice)
187185

188186
assert torch_all_close(output_slice, expected_output_slice, atol=1e-3)

tests/models/unets/test_models_unet_2d_condition.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ def create_ip_adapter_plus_state_dict(model):
175175
)
176176

177177
ip_image_projection_state_dict = OrderedDict()
178-
keys = [k for k in image_projection.state_dict() if "layers." in k]
179-
print(keys)
178+
180179
for k, v in image_projection.state_dict().items():
181180
if "2.to" in k:
182181
k = k.replace("2.to", "0.to")

tests/pipelines/controlnet/test_flax_controlnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_canny(self):
7878
expected_slice = jnp.array(
7979
[0.167969, 0.116699, 0.081543, 0.154297, 0.132812, 0.108887, 0.169922, 0.169922, 0.205078]
8080
)
81-
print(f"output_slice: {output_slice}")
81+
8282
assert jnp.abs(output_slice - expected_slice).max() < 1e-2
8383

8484
def test_pose(self):
@@ -123,5 +123,5 @@ def test_pose(self):
123123
expected_slice = jnp.array(
124124
[[0.271484, 0.261719, 0.275391, 0.277344, 0.279297, 0.291016, 0.294922, 0.302734, 0.302734]]
125125
)
126-
print(f"output_slice: {output_slice}")
126+
127127
assert jnp.abs(output_slice - expected_slice).max() < 1e-2

tests/pipelines/kandinsky/test_kandinsky_combined.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ def test_kandinsky(self):
308308

309309
image_from_tuple_slice = image_from_tuple[0, -3:, -3:, -1]
310310

311-
print(image_from_tuple_slice)
312-
313311
assert image.shape == (1, 64, 64, 3)
314312

315313
expected_slice = np.array([0.0320, 0.0860, 0.4013, 0.0518, 0.2484, 0.5847, 0.4411, 0.2321, 0.4593])

tests/pipelines/ledits_pp/test_ledits_pp_stable_diffusion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_ledits_pp_inversion(self):
146146
)
147147

148148
latent_slice = sd_pipe.init_latents[0, -1, -3:, -3:].to(device)
149-
print(latent_slice.flatten())
149+
150150
expected_slice = np.array([-0.9084, -0.0367, 0.2940, 0.0839, 0.6890, 0.2651, -0.7104, 2.1090, -0.7822])
151151
assert np.abs(latent_slice.flatten() - expected_slice).max() < 1e-3
152152

@@ -167,12 +167,12 @@ def test_ledits_pp_inversion_batch(self):
167167
)
168168

169169
latent_slice = sd_pipe.init_latents[0, -1, -3:, -3:].to(device)
170-
print(latent_slice.flatten())
170+
171171
expected_slice = np.array([0.2528, 0.1458, -0.2166, 0.4565, -0.5657, -1.0286, -0.9961, 0.5933, 1.1173])
172172
assert np.abs(latent_slice.flatten() - expected_slice).max() < 1e-3
173173

174174
latent_slice = sd_pipe.init_latents[1, -1, -3:, -3:].to(device)
175-
print(latent_slice.flatten())
175+
176176
expected_slice = np.array([-0.0796, 2.0583, 0.5501, 0.5358, 0.0282, -0.2803, -1.0470, 0.7023, -0.0072])
177177
assert np.abs(latent_slice.flatten() - expected_slice).max() < 1e-3
178178

tests/pipelines/ledits_pp/test_ledits_pp_stable_diffusion_xl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ def test_ledits_pp_inversion_batch(self):
216216
)
217217

218218
latent_slice = sd_pipe.init_latents[0, -1, -3:, -3:].to(device)
219-
print(latent_slice.flatten())
219+
220220
expected_slice = np.array([0.2528, 0.1458, -0.2166, 0.4565, -0.5656, -1.0286, -0.9961, 0.5933, 1.1172])
221221
assert np.abs(latent_slice.flatten() - expected_slice).max() < 1e-3
222222

223223
latent_slice = sd_pipe.init_latents[1, -1, -3:, -3:].to(device)
224-
print(latent_slice.flatten())
224+
225225
expected_slice = np.array([-0.0796, 2.0583, 0.5500, 0.5358, 0.0282, -0.2803, -1.0470, 0.7024, -0.0072])
226-
print(latent_slice.flatten())
226+
227227
assert np.abs(latent_slice.flatten() - expected_slice).max() < 1e-3
228228

229229
def test_ledits_pp_warmup_steps(self):

tests/pipelines/pag/test_pag_sd.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def test_pag_cfg(self):
318318

319319
image_slice = image[0, -3:, -3:, -1].flatten()
320320
assert image.shape == (1, 512, 512, 3)
321-
print(image_slice.flatten())
321+
322322
expected_slice = np.array(
323323
[0.58251953, 0.5722656, 0.5683594, 0.55029297, 0.52001953, 0.52001953, 0.49951172, 0.45410156, 0.50146484]
324324
)
@@ -339,7 +339,6 @@ def test_pag_uncond(self):
339339
expected_slice = np.array(
340340
[0.5986328, 0.52441406, 0.3972168, 0.4741211, 0.34985352, 0.22705078, 0.4128418, 0.2866211, 0.31713867]
341341
)
342-
print(image_slice.flatten())
343342
assert (
344343
np.abs(image_slice.flatten() - expected_slice).max() < 1e-3
345344
), f"output is different from expected, {image_slice.flatten()}"

tests/pipelines/pag/test_pag_sd_img2img.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_pag_cfg(self):
255255

256256
image_slice = image[0, -3:, -3:, -1].flatten()
257257
assert image.shape == (1, 512, 512, 3)
258-
print(image_slice.flatten())
258+
259259
expected_slice = np.array(
260260
[0.58251953, 0.5722656, 0.5683594, 0.55029297, 0.52001953, 0.52001953, 0.49951172, 0.45410156, 0.50146484]
261261
)
@@ -276,7 +276,7 @@ def test_pag_uncond(self):
276276
expected_slice = np.array(
277277
[0.5986328, 0.52441406, 0.3972168, 0.4741211, 0.34985352, 0.22705078, 0.4128418, 0.2866211, 0.31713867]
278278
)
279-
print(image_slice.flatten())
279+
280280
assert (
281281
np.abs(image_slice.flatten() - expected_slice).max() < 1e-3
282282
), f"output is different from expected, {image_slice.flatten()}"

tests/pipelines/pag/test_pag_sd_inpaint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def test_pag_cfg(self):
292292

293293
image_slice = image[0, -3:, -3:, -1].flatten()
294294
assert image.shape == (1, 512, 512, 3)
295-
print(image_slice.flatten())
295+
296296
expected_slice = np.array(
297297
[0.38793945, 0.4111328, 0.47924805, 0.39208984, 0.4165039, 0.41674805, 0.37060547, 0.36791992, 0.40625]
298298
)

0 commit comments

Comments
 (0)