-
Notifications
You must be signed in to change notification settings - Fork 1k
[Test] L4 complete diffusion feature test for LongCat Image Edit models #2035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Gaohan123
merged 10 commits into
vllm-project:main
from
NumberWan:longcat_image_edit_example
Mar 25, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0f3b560
[Test] L4 complete diffusion feature test for LongCat Image Edit models
NumberWan d89dacc
Fix: format
NumberWan 27cf0a4
Edit: only keep the recommended feature
NumberWan 968c59c
Edit: Changed target from 512x512 to 1024x1024 according the pipeline…
NumberWan db93d7c
Merge branch 'main' into longcat_image_edit_example
NumberWan 004cd7b
Edit: optimize the description
NumberWan a58cd4a
Changes for the Temp CI test
NumberWan 5588be9
Revert temp CI changes
NumberWan a679d9e
Merge branch 'main' into longcat_image_edit_example
NumberWan 32fd1ec
Merge branch 'main' into longcat_image_edit_example
NumberWan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
tests/e2e/online_serving/test_longcat_image_edit_expansion.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| """ | ||
| Recommended tests of diffusion features that are available in online serving mode | ||
| and are supported by the following model: | ||
| - LongCat-Image-Edit: image-to-image edit with a single image + single edit prompt input | ||
| Coverage: | ||
| - CPU offloading (model-level sequential offload via --enable-cpu-offload) | ||
| - Cache-DiT | ||
| - SP (Ulysses) | ||
|
|
||
| This validates: | ||
| - Successful image generation at the expected 1024x1024 resolution with recommended feature combinations | ||
| """ | ||
|
|
||
| import pytest | ||
|
|
||
| from tests.conftest import ( | ||
| OmniServer, | ||
| OmniServerParams, | ||
| OpenAIClientHandler, | ||
| dummy_messages_from_mix_data, | ||
| generate_synthetic_image, | ||
| ) | ||
| from tests.utils import hardware_marks | ||
|
|
||
| EDIT_PROMPT = "Transform this modern image into a cinematic animation style with vibrant colors and soft lighting." | ||
| NEGATIVE_PROMPT = "blurry, low quality, distorted, oversaturated" | ||
| SINGLE_CARD_FEATURE_MARKS = hardware_marks(res={"cuda": "H100"}) | ||
| PARALLEL_FEATURE_MARKS = hardware_marks(res={"cuda": "H100"}, num_cards=2) | ||
|
|
||
|
|
||
| def _get_diffusion_feature_cases(model: str): | ||
| """Return diffusion feature cases for LongCat-Image-Edit.""" | ||
|
NumberWan marked this conversation as resolved.
|
||
| return [ | ||
| pytest.param( | ||
|
NumberWan marked this conversation as resolved.
|
||
| OmniServerParams( | ||
| model=model, | ||
| server_args=["--enable-cpu-offload"], | ||
| ), | ||
| id="single_card_001", | ||
| marks=SINGLE_CARD_FEATURE_MARKS, | ||
| ), | ||
| pytest.param( | ||
| OmniServerParams( | ||
| model=model, | ||
| server_args=[ | ||
| "--cache-backend", | ||
| "cache_dit", | ||
| "--ulysses-degree", | ||
| "2", | ||
|
NumberWan marked this conversation as resolved.
|
||
| ], | ||
| ), | ||
| id="parallel_001", | ||
| marks=PARALLEL_FEATURE_MARKS, | ||
| ), | ||
| ] | ||
|
|
||
|
|
||
| @pytest.mark.advanced_model | ||
| @pytest.mark.diffusion | ||
| @pytest.mark.parametrize( | ||
| "omni_server", | ||
| _get_diffusion_feature_cases("meituan-longcat/LongCat-Image-Edit"), | ||
| indirect=True, | ||
| ) | ||
| def test_longcat_image_edit(omni_server: OmniServer, openai_client: OpenAIClientHandler): | ||
| """Test the recommended feature combinations for LongCat-Image-Edit.""" | ||
| image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(512, 512)['base64']}" | ||
| messages = dummy_messages_from_mix_data(image_data_url=image_data_url, content_text=EDIT_PROMPT) | ||
|
|
||
| request_config = { | ||
| "model": omni_server.model, | ||
| "messages": messages, | ||
| "extra_body": { | ||
| "height": 1024, | ||
| "width": 1024, | ||
| "num_inference_steps": 2, | ||
| "negative_prompt": NEGATIVE_PROMPT, | ||
| "guidance_scale": 4.0, | ||
| "seed": 42, | ||
| }, | ||
| } | ||
|
|
||
| openai_client.send_diffusion_request(request_config) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.