Skip to content

Add missing dataset download to Qwen-Image validate examples - #1667

Open
rakhimovv wants to merge 1 commit into
modelscope:mainfrom
rakhimovv:fix-validate-dataset-download
Open

Add missing dataset download to Qwen-Image validate examples#1667
rakhimovv wants to merge 1 commit into
modelscope:mainfrom
rakhimovv:fix-validate-dataset-download

Conversation

@rakhimovv

Copy link
Copy Markdown

The validate_full and validate_lora scripts under examples/qwen_image/model_training/ read data/example_image_dataset/ but never fetch it.

For edit/ and eligen/ this is not recoverable by running things in a particular order: at 4dbf980, nothing under examples/qwen_image/ downloads either subdirectory. So these fail even under the ordering in examples/dev_tools/unit_test.py, which runs model_inference before validate_lora. Running test_qwen_image() on a clean checkout, 7 of the 18 scripts in validate_lora fail like this:

Traceback (most recent call last):
  File ".../validate_lora/FireRed-Image-Edit-1.0.py", line 20, in <module>
    Image.open("data/example_image_dataset/edit/image1.jpg").resize((1024, 1024)),
FileNotFoundError: [Errno 2] No such file or directory: 'data/example_image_dataset/edit/image1.jpg'

(edit/image1.jpg is fetched by examples/boogu_image/, so a full cross-family run rescues some of these; edit/image_color.jpg and eligen/ are fetched nowhere in the repo.)

How the 18 validate_lora scripts divide:

  • 11 read the dataset without fetching it. Of those, 7 fail as above, and 4 (canny, two layer, layer_v2) happen to pass because the matching model_inference scripts fetch that data into the same directory first.
  • 3 already call dataset_snapshot_download (the Blockwise ControlNet scripts).
  • 4 don't reference the dataset at all.

validate_full/ has the same problem in 7 more files. The sibling model_training/lora/*.sh scripts don't help either way: they fetch diffsynth_example_dataset to a different path.

This adds the call the three existing scripts use, following their convention of naming a single file directly (canny/image_1.jpg, depth/image_1.jpg) and globbing only where several are read (inpaint/*.jpg):

dataset_snapshot_download(
    dataset_id="DiffSynth-Studio/example_image_dataset",
    local_dir="./data/example_image_dataset",
    allow_file_pattern="edit/*.jpg"
)

Qwen-Image-Layered-Control-V2.py is included because it imports dataset_snapshot_download but never calls it, so a grep for the name makes it look fine.

This may also be what #1009 is asking about.

Checking

All 11 validate_lora scripts were run on 1×H100 against LoRAs trained by the model_training/lora/*.sh scripts in the same tree, and all produced output (e.g. Qwen-Image-Edit.py 80s, Qwen-Image-Edit-2509.py 105s, FireRed-Image-Edit-1.0.py 124s, Qwen-Image-EliGen.py 50s).

To confirm the download patterns themselves rather than relying on data an earlier script had left behind, I re-ran four of them in a fresh working directory with an empty data/: Qwen-Image-Edit.py (edit/image1.jpg), FireRed-Image-Edit-1.0.py (edit/*.jpg), Qwen-Image-EliGen.py (eligen/*.png) and Qwen-Image-Layered-Control.py (layer/image.png). Each fetched exactly its own inputs and produced an image, covering both pattern forms.

I have not run the 7 validate_full scripts — that needs a full fine-tune, and the accelerate configs are set up for 8 GPUs. Their change is the same one-call addition, but please treat those as unverified.

The same pattern appears in flux, wanvideo, z_image, mova and ltx2 (105 files repo-wide by the same static check, of which I have run 12). I kept this PR to qwen_image rather than sending a cross-family change unasked; glad to follow up on the others if that would help.

The validate_full and validate_lora scripts read data/example_image_dataset/
but never fetch it. Nothing in examples/qwen_image/ downloads the edit/ or
eligen/ subdirectories, so those scripts fail even under the ordering in
examples/dev_tools/unit_test.py; the canny/ and layer/ ones only succeed
because the matching model_inference scripts fetched that data earlier.

Adds the dataset_snapshot_download call used by the three scripts in
validate_lora that already fetch their data, following the same convention of
naming a single file directly and globbing only where several are read.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant