diffusers 0.35.0__py3-none-any.whl → 0.35.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffusers/__init__.py +1 -1
- diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py +4 -37
- {diffusers-0.35.0.dist-info → diffusers-0.35.1.dist-info}/METADATA +1 -1
- {diffusers-0.35.0.dist-info → diffusers-0.35.1.dist-info}/RECORD +8 -8
- {diffusers-0.35.0.dist-info → diffusers-0.35.1.dist-info}/LICENSE +0 -0
- {diffusers-0.35.0.dist-info → diffusers-0.35.1.dist-info}/WHEEL +0 -0
- {diffusers-0.35.0.dist-info → diffusers-0.35.1.dist-info}/entry_points.txt +0 -0
- {diffusers-0.35.0.dist-info → diffusers-0.35.1.dist-info}/top_level.txt +0 -0
diffusers/__init__.py
CHANGED
@@ -62,25 +62,6 @@ EXAMPLE_DOC_STRING = """
|
|
62
62
|
>>> image.save("qwenimage_edit.png")
|
63
63
|
```
|
64
64
|
"""
|
65
|
-
PREFERRED_QWENIMAGE_RESOLUTIONS = [
|
66
|
-
(672, 1568),
|
67
|
-
(688, 1504),
|
68
|
-
(720, 1456),
|
69
|
-
(752, 1392),
|
70
|
-
(800, 1328),
|
71
|
-
(832, 1248),
|
72
|
-
(880, 1184),
|
73
|
-
(944, 1104),
|
74
|
-
(1024, 1024),
|
75
|
-
(1104, 944),
|
76
|
-
(1184, 880),
|
77
|
-
(1248, 832),
|
78
|
-
(1328, 800),
|
79
|
-
(1392, 752),
|
80
|
-
(1456, 720),
|
81
|
-
(1504, 688),
|
82
|
-
(1568, 672),
|
83
|
-
]
|
84
65
|
|
85
66
|
|
86
67
|
# Copied from diffusers.pipelines.qwenimage.pipeline_qwenimage.calculate_shift
|
@@ -565,7 +546,6 @@ class QwenImageEditPipeline(DiffusionPipeline, QwenImageLoraLoaderMixin):
|
|
565
546
|
callback_on_step_end: Optional[Callable[[int, int, Dict], None]] = None,
|
566
547
|
callback_on_step_end_tensor_inputs: List[str] = ["latents"],
|
567
548
|
max_sequence_length: int = 512,
|
568
|
-
_auto_resize: bool = True,
|
569
549
|
):
|
570
550
|
r"""
|
571
551
|
Function invoked when calling the pipeline for generation.
|
@@ -646,8 +626,7 @@ class QwenImageEditPipeline(DiffusionPipeline, QwenImageLoraLoaderMixin):
|
|
646
626
|
returning a tuple, the first element is a list with the generated images.
|
647
627
|
"""
|
648
628
|
image_size = image[0].size if isinstance(image, list) else image.size
|
649
|
-
|
650
|
-
calculated_width, calculated_height, _ = calculate_dimensions(1024 * 1024, width / height)
|
629
|
+
calculated_width, calculated_height, _ = calculate_dimensions(1024 * 1024, image_size[0] / image_size[1])
|
651
630
|
height = height or calculated_height
|
652
631
|
width = width or calculated_width
|
653
632
|
|
@@ -685,18 +664,9 @@ class QwenImageEditPipeline(DiffusionPipeline, QwenImageLoraLoaderMixin):
|
|
685
664
|
device = self._execution_device
|
686
665
|
# 3. Preprocess image
|
687
666
|
if image is not None and not (isinstance(image, torch.Tensor) and image.size(1) == self.latent_channels):
|
688
|
-
|
689
|
-
image_height, image_width = self.image_processor.get_default_height_width(img)
|
690
|
-
aspect_ratio = image_width / image_height
|
691
|
-
if _auto_resize:
|
692
|
-
_, image_width, image_height = min(
|
693
|
-
(abs(aspect_ratio - w / h), w, h) for w, h in PREFERRED_QWENIMAGE_RESOLUTIONS
|
694
|
-
)
|
695
|
-
image_width = image_width // multiple_of * multiple_of
|
696
|
-
image_height = image_height // multiple_of * multiple_of
|
697
|
-
image = self.image_processor.resize(image, image_height, image_width)
|
667
|
+
image = self.image_processor.resize(image, calculated_height, calculated_width)
|
698
668
|
prompt_image = image
|
699
|
-
image = self.image_processor.preprocess(image,
|
669
|
+
image = self.image_processor.preprocess(image, calculated_height, calculated_width)
|
700
670
|
image = image.unsqueeze(2)
|
701
671
|
|
702
672
|
has_neg_prompt = negative_prompt is not None or (
|
@@ -713,9 +683,6 @@ class QwenImageEditPipeline(DiffusionPipeline, QwenImageLoraLoaderMixin):
|
|
713
683
|
max_sequence_length=max_sequence_length,
|
714
684
|
)
|
715
685
|
if do_true_cfg:
|
716
|
-
# negative image is the same size as the original image, but all pixels are white
|
717
|
-
# negative_image = Image.new("RGB", (image.width, image.height), (255, 255, 255))
|
718
|
-
|
719
686
|
negative_prompt_embeds, negative_prompt_embeds_mask = self.encode_prompt(
|
720
687
|
image=prompt_image,
|
721
688
|
prompt=negative_prompt,
|
@@ -742,7 +709,7 @@ class QwenImageEditPipeline(DiffusionPipeline, QwenImageLoraLoaderMixin):
|
|
742
709
|
img_shapes = [
|
743
710
|
[
|
744
711
|
(1, height // self.vae_scale_factor // 2, width // self.vae_scale_factor // 2),
|
745
|
-
(1,
|
712
|
+
(1, calculated_height // self.vae_scale_factor // 2, calculated_width // self.vae_scale_factor // 2),
|
746
713
|
]
|
747
714
|
] * batch_size
|
748
715
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: diffusers
|
3
|
-
Version: 0.35.
|
3
|
+
Version: 0.35.1
|
4
4
|
Summary: State-of-the-art diffusion in PyTorch and JAX.
|
5
5
|
Home-page: https://github.com/huggingface/diffusers
|
6
6
|
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/diffusers/graphs/contributors)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
diffusers/__init__.py,sha256=
|
1
|
+
diffusers/__init__.py,sha256=ez_SaG7tS8y601bNDEVjOX-_7BXe7KdUrG9PCsQ6kY0,50085
|
2
2
|
diffusers/callbacks.py,sha256=9NgQ7QkUncjVR8pbCHEd-PYvf5xKD-QRDmOoAjyzoXY,10282
|
3
3
|
diffusers/configuration_utils.py,sha256=sf1KSxuGJSPo9beQvEXt8PolG0OVXdYF9WDRYssDGug,34942
|
4
4
|
diffusers/dependency_versions_check.py,sha256=PcT_deWuvIKrNkjkCnQKi0ZTWCl77tHC02lhttbqQHM,1271
|
@@ -461,7 +461,7 @@ diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py,sha256=V0zzovrP3DC-J7z
|
|
461
461
|
diffusers/pipelines/qwenimage/__init__.py,sha256=0Bh0rr7S-9V3uA3fm0cZhpi1ASTuChOdTHlq2s2Rv-A,2044
|
462
462
|
diffusers/pipelines/qwenimage/pipeline_output.py,sha256=TbhkYg7Uq10TNp_mIDvm7imSEh8LK0hFpQ018gCVaYk,603
|
463
463
|
diffusers/pipelines/qwenimage/pipeline_qwenimage.py,sha256=Tqsf8Ax8SKRChYtr7wjL2936miNfp5oqfdUZA9K1xpE,34535
|
464
|
-
diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py,sha256=
|
464
|
+
diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py,sha256=qD5btDMHYoSMlCNVmHu7BMoscb8XNoDufxtVzUVxQm0,40451
|
465
465
|
diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py,sha256=FMYy0J8vN_E7Hpcg0bXmvmotJuBiOU7TfwJPoN5185A,40812
|
466
466
|
diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py,sha256=wGbXWHnRfmtU0SEPV34y9CTSEpus1OVP7UNbItiBuBs,49677
|
467
467
|
diffusers/pipelines/sana/__init__.py,sha256=qkgbJxOAEH4gmyQ4FX4USnOd-PPEDkZGjZ3QO0ID0pA,1719
|
@@ -695,9 +695,9 @@ diffusers/utils/testing_utils.py,sha256=LSFTPVApvPOK9EHJYmgrUSRXzyYuHXFmEWHzvgF-
|
|
695
695
|
diffusers/utils/torch_utils.py,sha256=ogvNvRfOryc5riP-Ph_nopGEsuZtmIszMIDPrkSgnAY,7775
|
696
696
|
diffusers/utils/typing_utils.py,sha256=yeuCJmb1t5n5rG1JRPJo33KO7tg_m9ZwSXQcPKiKyFA,3400
|
697
697
|
diffusers/utils/versions.py,sha256=-e7XW1TzZ-tsRo9PMQHp-hNGYHuVDFzLtwg3uAJzqdI,4333
|
698
|
-
diffusers-0.35.
|
699
|
-
diffusers-0.35.
|
700
|
-
diffusers-0.35.
|
701
|
-
diffusers-0.35.
|
702
|
-
diffusers-0.35.
|
703
|
-
diffusers-0.35.
|
698
|
+
diffusers-0.35.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
699
|
+
diffusers-0.35.1.dist-info/METADATA,sha256=2YroDyHqhHv9IcdMEoodiSq5KijgbvS9mrwCfNOJFB8,20120
|
700
|
+
diffusers-0.35.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
701
|
+
diffusers-0.35.1.dist-info/entry_points.txt,sha256=_1bvshKV_6_b63_FAkcUs9W6tUKGeIoQ3SHEZsovEWs,72
|
702
|
+
diffusers-0.35.1.dist-info/top_level.txt,sha256=axJl2884vMSvhzrFrSoht36QXA_6gZN9cKtg4xOO72o,10
|
703
|
+
diffusers-0.35.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|