Skip to content

Commit 828dd32

Browse files
committed
Merge branch 'main' into fast-gpu-test-fixes
2 parents 721501c + 764d7ed commit 828dd32

20 files changed

+1914
-287
lines changed

.github/workflows/pr_style_bot.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ jobs:
5353
HEADREF: ${{ steps.pr_info.outputs.headRef }}
5454
PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
5555
run: |
56-
echo "PR number: ${{ env.PRNUMBER }}"
57-
echo "Head Ref: ${{ env.HEADREF }}"
58-
echo "Head Repo Full Name: ${{ env.HEADREPOFULLNAME }}"
56+
echo "PR number: $PRNUMBER"
57+
echo "Head Ref: $HEADREF"
58+
echo "Head Repo Full Name: $HEADREPOFULLNAME"
5959
6060
- name: Set up Python
6161
uses: actions/setup-python@v4
@@ -89,20 +89,20 @@ jobs:
8989
PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
9090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9191
run: |
92-
echo "HEADREPOFULLNAME: ${{ env.HEADREPOFULLNAME }}, HEADREF: ${{ env.HEADREF }}"
92+
echo "HEADREPOFULLNAME: $HEADREPOFULLNAME, HEADREF: $HEADREF"
9393
# Configure git with the Actions bot user
9494
git config user.name "github-actions[bot]"
9595
git config user.email "github-actions[bot]@users.noreply.github.com"
9696
9797
# Make sure your 'origin' remote is set to the contributor's fork
98-
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ env.HEADREPOFULLNAME }}.git"
98+
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/$HEADREPOFULLNAME.git"
9999
100100
# If there are changes after running style/quality, commit them
101101
if [ -n "$(git status --porcelain)" ]; then
102102
git add .
103103
git commit -m "Apply style fixes"
104104
# Push to the original contributor's forked branch
105-
git push origin HEAD:${{ env.HEADREF }}
105+
git push origin HEAD:$HEADREF
106106
echo "changes_pushed=true" >> $GITHUB_OUTPUT
107107
else
108108
echo "No changes to commit."

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

Lines changed: 89 additions & 34 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The table below lists all the pipelines currently available in 🤗 Diffusers an
6565
| [Latte](latte) | text2image |
6666
| [LEDITS++](ledits_pp) | image editing |
6767
| [Lumina-T2X](lumina) | text2image |
68-
| [Marigold](marigold) | depth |
68+
| [Marigold](marigold) | depth-estimation, normals-estimation, intrinsic-decomposition |
6969
| [MultiDiffusion](panorama) | text2image |
7070
| [MusicLDM](musicldm) | text2audio |
7171
| [PAG](pag) | text2image |

docs/source/en/using-diffusers/marigold_usage.md

Lines changed: 312 additions & 173 deletions
Large diffs are not rendered by default.

src/diffusers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@
345345
"Lumina2Text2ImgPipeline",
346346
"LuminaText2ImgPipeline",
347347
"MarigoldDepthPipeline",
348+
"MarigoldIntrinsicsPipeline",
348349
"MarigoldNormalsPipeline",
349350
"MochiPipeline",
350351
"MusicLDMPipeline",
@@ -845,6 +846,7 @@
845846
Lumina2Text2ImgPipeline,
846847
LuminaText2ImgPipeline,
847848
MarigoldDepthPipeline,
849+
MarigoldIntrinsicsPipeline,
848850
MarigoldNormalsPipeline,
849851
MochiPipeline,
850852
MusicLDMPipeline,

src/diffusers/pipelines/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
_import_structure["marigold"].extend(
262262
[
263263
"MarigoldDepthPipeline",
264+
"MarigoldIntrinsicsPipeline",
264265
"MarigoldNormalsPipeline",
265266
]
266267
)
@@ -603,6 +604,7 @@
603604
from .lumina2 import Lumina2Text2ImgPipeline
604605
from .marigold import (
605606
MarigoldDepthPipeline,
607+
MarigoldIntrinsicsPipeline,
606608
MarigoldNormalsPipeline,
607609
)
608610
from .mochi import MochiPipeline

src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ class StableDiffusionXLControlNetInpaintPipeline(
237237
"add_neg_time_ids",
238238
"mask",
239239
"masked_image_latents",
240+
"control_image",
240241
]
241242

242243
def __init__(
@@ -743,15 +744,15 @@ def check_inputs(
743744
if padding_mask_crop is not None:
744745
if not isinstance(image, PIL.Image.Image):
745746
raise ValueError(
746-
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}."
747+
f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
747748
)
748749
if not isinstance(mask_image, PIL.Image.Image):
749750
raise ValueError(
750751
f"The mask image should be a PIL image when inpainting mask crop, but is of type"
751752
f" {type(mask_image)}."
752753
)
753754
if output_type != "pil":
754-
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.")
755+
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
755756

756757
if prompt_embeds is not None and pooled_prompt_embeds is None:
757758
raise ValueError(
@@ -1644,7 +1645,7 @@ def denoising_value_valid(dnv):
16441645
f"Incorrect configuration settings! The config of `pipeline.unet`: {self.unet.config} expects"
16451646
f" {self.unet.config.in_channels} but received `num_channels_latents`: {num_channels_latents} +"
16461647
f" `num_channels_mask`: {num_channels_mask} + `num_channels_masked_image`: {num_channels_masked_image}"
1647-
f" = {num_channels_latents+num_channels_masked_image+num_channels_mask}. Please verify the config of"
1648+
f" = {num_channels_latents + num_channels_masked_image + num_channels_mask}. Please verify the config of"
16481649
" `pipeline.unet` or your `mask_image` or `image` input."
16491650
)
16501651
elif num_channels_unet != 4:
@@ -1835,6 +1836,7 @@ def denoising_value_valid(dnv):
18351836
latents = callback_outputs.pop("latents", latents)
18361837
prompt_embeds = callback_outputs.pop("prompt_embeds", prompt_embeds)
18371838
negative_prompt_embeds = callback_outputs.pop("negative_prompt_embeds", negative_prompt_embeds)
1839+
control_image = callback_outputs.pop("control_image", control_image)
18381840

18391841
# call the callback, if provided
18401842
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):

src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl_img2img.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ class StableDiffusionXLControlNetImg2ImgPipeline(
242242
"add_time_ids",
243243
"negative_pooled_prompt_embeds",
244244
"add_neg_time_ids",
245+
"control_image",
245246
]
246247

247248
def __init__(
@@ -1614,6 +1615,7 @@ def __call__(
16141615
)
16151616
add_time_ids = callback_outputs.pop("add_time_ids", add_time_ids)
16161617
add_neg_time_ids = callback_outputs.pop("add_neg_time_ids", add_neg_time_ids)
1618+
control_image = callback_outputs.pop("control_image", control_image)
16171619

16181620
# call the callback, if provided
16191621
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):

src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ class StableDiffusionXLControlNetUnionInpaintPipeline(
219219
"add_time_ids",
220220
"mask",
221221
"masked_image_latents",
222+
"control_image",
222223
]
223224

224225
def __init__(
@@ -726,15 +727,15 @@ def check_inputs(
726727
if padding_mask_crop is not None:
727728
if not isinstance(image, PIL.Image.Image):
728729
raise ValueError(
729-
f"The image should be a PIL image when inpainting mask crop, but is of type" f" {type(image)}."
730+
f"The image should be a PIL image when inpainting mask crop, but is of type {type(image)}."
730731
)
731732
if not isinstance(mask_image, PIL.Image.Image):
732733
raise ValueError(
733734
f"The mask image should be a PIL image when inpainting mask crop, but is of type"
734735
f" {type(mask_image)}."
735736
)
736737
if output_type != "pil":
737-
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is" f" {output_type}.")
738+
raise ValueError(f"The output type should be PIL when inpainting mask crop, but is {output_type}.")
738739

739740
if prompt_embeds is not None and pooled_prompt_embeds is None:
740741
raise ValueError(
@@ -1743,6 +1744,7 @@ def denoising_value_valid(dnv):
17431744
latents = callback_outputs.pop("latents", latents)
17441745
prompt_embeds = callback_outputs.pop("prompt_embeds", prompt_embeds)
17451746
negative_prompt_embeds = callback_outputs.pop("negative_prompt_embeds", negative_prompt_embeds)
1747+
control_image = callback_outputs.pop("control_image", control_image)
17461748

17471749
# call the callback, if provided
17481750
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):

src/diffusers/pipelines/controlnet/pipeline_controlnet_union_sd_xl_img2img.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,7 @@ class StableDiffusionXLControlNetUnionImg2ImgPipeline(
252252
"feature_extractor",
253253
"image_encoder",
254254
]
255-
_callback_tensor_inputs = [
256-
"latents",
257-
"prompt_embeds",
258-
"add_text_embeds",
259-
"add_time_ids",
260-
]
255+
_callback_tensor_inputs = ["latents", "prompt_embeds", "add_text_embeds", "add_time_ids", "control_image"]
261256

262257
def __init__(
263258
self,
@@ -1562,6 +1557,7 @@ def __call__(
15621557
prompt_embeds = callback_outputs.pop("prompt_embeds", prompt_embeds)
15631558
add_text_embeds = callback_outputs.pop("add_text_embeds", add_text_embeds)
15641559
add_time_ids = callback_outputs.pop("add_time_ids", add_time_ids)
1560+
control_image = callback_outputs.pop("control_image", control_image)
15651561

15661562
# call the callback, if provided
15671563
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):

0 commit comments

Comments
 (0)