From 06353cbf60eed8f58a86a01b4b9f49f6e9640c1e Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 13 May 2026 16:09:00 +0900 Subject: [PATCH 1/5] add serge reviewer to enable claude for inline reviews. --- .claude/settings.local.json | 15 +++++ .github/workflows/serge_review.yml | 66 +++++++++++++++++++ .../controlnet_flux/test_controlnet_flux.py | 4 +- .../test_controlnet_hunyuandit.py | 4 +- .../test_controlnet_inpaint_sd3.py | 6 +- .../controlnet_sd3/test_controlnet_sd3.py | 4 +- 6 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 .claude/settings.local.json create mode 100644 .github/workflows/serge_review.yml diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 000000000000..e4849704d499 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,15 @@ +{ + "permissions": { + "allow": [ + "Bash(CUDA_VISIBLE_DEVICES=\"\" python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd3 -x)", + "Bash(CUDA_VISIBLE_DEVICES=\"\" python *)", + "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd3 -x)", + "Bash(pip show *)", + "Bash(CUDA_VISIBLE_DEVICES=\"\" DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd35 tests/pipelines/controlnet_flux/test_controlnet_flux.py::FluxControlNetPipelineFastTests::test_controlnet_flux tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py::HunyuanDiTControlNetPipelineFastTests::test_controlnet_hunyuandit tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py::StableDiffusion3ControlInpaintNetPipelineFastTests::test_controlnet_inpaint_sd3)", + "Bash(python *)", + "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd35 -x)", + "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_flux/test_controlnet_flux.py::FluxControlNetPipelineFastTests::test_controlnet_flux -x)", + "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py::HunyuanDiTControlNetPipelineFastTests::test_controlnet_hunyuandit -x)" + ] + } +} diff --git a/.github/workflows/serge_review.yml b/.github/workflows/serge_review.yml new file mode 100644 index 000000000000..c637736ef1a3 --- /dev/null +++ b/.github/workflows/serge_review.yml @@ -0,0 +1,66 @@ +name: Claude AI Review with inline comments + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + +permissions: + contents: read + pull-requests: write + issues: read + +jobs: + claude-ai-review: + if: | + ( + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + github.event.issue.state == 'open' && + contains(github.event.comment.body, '@claude') && + (github.event.comment.author_association == 'MEMBER' || + github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'COLLABORATOR') + ) || ( + github.event_name == 'pull_request_review_comment' && + contains(github.event.comment.body, '@claude') && + (github.event.comment.author_association == 'MEMBER' || + github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'COLLABORATOR') + ) + concurrency: + group: claude-ai-review-${{ github.event.issue.number || github.event.pull_request.number }} + cancel-in-progress: false + runs-on: ubuntu-latest + steps: + - name: Resolve PR number + id: pr + run: | + NUM="${{ github.event.issue.number || github.event.pull_request.number }}" + echo "number=${NUM}" >> "$GITHUB_OUTPUT" + + - name: Check out PR head (shallow) + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: refs/pull/${{ steps.pr.outputs.number }}/head + fetch-depth: 1 + + - name: Strip fork-supplied reviewer/agent config + # ai-reviewer fetches its config (.ai/review-rules.md, .ai/review-tools.json, + # .ai/context-script) from the base repo's default branch via the GitHub + # Contents API, so wiping the fork's local copies does not affect rule + # loading. The wipe matters because the action also exposes read-only + # browse tools (read_file/list_dir/grep) rooted at the PR-head checkout — + # without this step a fork could ship its own .ai/review-tools.json or + # .ai/context-script and surface them to the LLM. .claude/ + CLAUDE.md + # are wiped for parity with the hardening in claude_review.yml. + run: rm -rf .ai/ .claude/ CLAUDE.md + + - uses: tarekziade/ai-reviewer@main + with: + llm_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + llm_api_base: https://api.anthropic.com + llm_model: claude-opus-4-6 + llm_stream: 'true' + mention_trigger: '@claude' diff --git a/tests/pipelines/controlnet_flux/test_controlnet_flux.py b/tests/pipelines/controlnet_flux/test_controlnet_flux.py index 8607cd6944d9..4d5471571d04 100644 --- a/tests/pipelines/controlnet_flux/test_controlnet_flux.py +++ b/tests/pipelines/controlnet_flux/test_controlnet_flux.py @@ -143,7 +143,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.5 @@ -163,7 +163,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_flux(self): components = self.get_dummy_components() flux_pipe = FluxControlNetPipeline(**components) - flux_pipe = flux_pipe.to(torch_device, dtype=torch.float16) + flux_pipe = flux_pipe.to(torch_device, dtype=torch.float32) flux_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) diff --git a/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py b/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py index 034ef56b0fd3..d7cfc5c91556 100644 --- a/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py +++ b/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py @@ -126,7 +126,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 16, 16), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.5 @@ -146,7 +146,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_hunyuandit(self): components = self.get_dummy_components() pipe = HunyuanDiTControlNetPipeline(**components) - pipe = pipe.to(torch_device, dtype=torch.float16) + pipe = pipe.to(torch_device, dtype=torch.float32) pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) diff --git a/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py b/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py index 072f9aa405d9..4c00eefdbc60 100644 --- a/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py +++ b/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py @@ -156,14 +156,14 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) control_mask = randn_tensor( (1, 1, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.95 @@ -184,7 +184,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_inpaint_sd3(self): components = self.get_dummy_components() sd_pipe = StableDiffusion3ControlNetInpaintingPipeline(**components) - sd_pipe = sd_pipe.to(torch_device, dtype=torch.float16) + sd_pipe = sd_pipe.to(torch_device, dtype=torch.float32) sd_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) diff --git a/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py b/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py index 46b08cf1f00b..1a37eb0c245d 100644 --- a/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py +++ b/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py @@ -173,7 +173,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.5 @@ -192,7 +192,7 @@ def get_dummy_inputs(self, device, seed=0): def run_pipe(self, components, use_sd35=False): sd_pipe = StableDiffusion3ControlNetPipeline(**components) - sd_pipe = sd_pipe.to(torch_device, dtype=torch.float16) + sd_pipe = sd_pipe.to(torch_device, dtype=torch.float32) sd_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) From 31b949d323e4dda4772f59c57b9c0e9e8bbbf2bc Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 13 May 2026 16:09:15 +0900 Subject: [PATCH 2/5] remove local settings --- .claude/settings.local.json | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index e4849704d499..000000000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(CUDA_VISIBLE_DEVICES=\"\" python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd3 -x)", - "Bash(CUDA_VISIBLE_DEVICES=\"\" python *)", - "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd3 -x)", - "Bash(pip show *)", - "Bash(CUDA_VISIBLE_DEVICES=\"\" DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd35 tests/pipelines/controlnet_flux/test_controlnet_flux.py::FluxControlNetPipelineFastTests::test_controlnet_flux tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py::HunyuanDiTControlNetPipelineFastTests::test_controlnet_hunyuandit tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py::StableDiffusion3ControlInpaintNetPipelineFastTests::test_controlnet_inpaint_sd3)", - "Bash(python *)", - "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_sd3/test_controlnet_sd3.py::StableDiffusion3ControlNetPipelineFastTests::test_controlnet_sd35 -x)", - "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_flux/test_controlnet_flux.py::FluxControlNetPipelineFastTests::test_controlnet_flux -x)", - "Bash(DIFFUSERS_TEST_DEVICE=cpu python -m pytest tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py::HunyuanDiTControlNetPipelineFastTests::test_controlnet_hunyuandit -x)" - ] - } -} From d0745feba8bd1cda2267ee8249db766694b8b2c1 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 13 May 2026 16:19:30 +0900 Subject: [PATCH 3/5] up --- tests/pipelines/controlnet_flux/test_controlnet_flux.py | 4 ++-- .../controlnet_hunyuandit/test_controlnet_hunyuandit.py | 4 ++-- .../pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/pipelines/controlnet_flux/test_controlnet_flux.py b/tests/pipelines/controlnet_flux/test_controlnet_flux.py index 4d5471571d04..8607cd6944d9 100644 --- a/tests/pipelines/controlnet_flux/test_controlnet_flux.py +++ b/tests/pipelines/controlnet_flux/test_controlnet_flux.py @@ -143,7 +143,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float32, + dtype=torch.float16, ) controlnet_conditioning_scale = 0.5 @@ -163,7 +163,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_flux(self): components = self.get_dummy_components() flux_pipe = FluxControlNetPipeline(**components) - flux_pipe = flux_pipe.to(torch_device, dtype=torch.float32) + flux_pipe = flux_pipe.to(torch_device, dtype=torch.float16) flux_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) diff --git a/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py b/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py index d7cfc5c91556..034ef56b0fd3 100644 --- a/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py +++ b/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py @@ -126,7 +126,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 16, 16), generator=generator, device=torch.device(device), - dtype=torch.float32, + dtype=torch.float16, ) controlnet_conditioning_scale = 0.5 @@ -146,7 +146,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_hunyuandit(self): components = self.get_dummy_components() pipe = HunyuanDiTControlNetPipeline(**components) - pipe = pipe.to(torch_device, dtype=torch.float32) + pipe = pipe.to(torch_device, dtype=torch.float16) pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) diff --git a/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py b/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py index 4c00eefdbc60..072f9aa405d9 100644 --- a/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py +++ b/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py @@ -156,14 +156,14 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float32, + dtype=torch.float16, ) control_mask = randn_tensor( (1, 1, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float32, + dtype=torch.float16, ) controlnet_conditioning_scale = 0.95 @@ -184,7 +184,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_inpaint_sd3(self): components = self.get_dummy_components() sd_pipe = StableDiffusion3ControlNetInpaintingPipeline(**components) - sd_pipe = sd_pipe.to(torch_device, dtype=torch.float32) + sd_pipe = sd_pipe.to(torch_device, dtype=torch.float16) sd_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) From 17dea929b4412d44531a7ea450fef156668c19e1 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 13 May 2026 16:21:12 +0900 Subject: [PATCH 4/5] up --- tests/pipelines/controlnet_sd3/test_controlnet_sd3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py b/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py index 1a37eb0c245d..46b08cf1f00b 100644 --- a/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py +++ b/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py @@ -173,7 +173,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float32, + dtype=torch.float16, ) controlnet_conditioning_scale = 0.5 @@ -192,7 +192,7 @@ def get_dummy_inputs(self, device, seed=0): def run_pipe(self, components, use_sd35=False): sd_pipe = StableDiffusion3ControlNetPipeline(**components) - sd_pipe = sd_pipe.to(torch_device, dtype=torch.float32) + sd_pipe = sd_pipe.to(torch_device, dtype=torch.float16) sd_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) From ecb5b6d8aab627ab29d055f6ae2860280e6004de Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Wed, 13 May 2026 16:30:26 +0900 Subject: [PATCH 5/5] switch the trigger word to goku --- .github/workflows/serge_review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/serge_review.yml b/.github/workflows/serge_review.yml index c637736ef1a3..692cb488b95c 100644 --- a/.github/workflows/serge_review.yml +++ b/.github/workflows/serge_review.yml @@ -63,4 +63,4 @@ jobs: llm_api_base: https://api.anthropic.com llm_model: claude-opus-4-6 llm_stream: 'true' - mention_trigger: '@claude' + mention_trigger: '@goku'