Skip to content

Keep Z-Image target timesteps and sigmas aligned - #1661

Open
zjn20030811 wants to merge 1 commit into
modelscope:mainfrom
zjn20030811:fix/z-image-target-sigmas
Open

Keep Z-Image target timesteps and sigmas aligned#1661
zjn20030811 wants to merge 1 commit into
modelscope:mainfrom
zjn20030811:fix/z-image-target-sigmas

Conversation

@zjn20030811

Copy link
Copy Markdown

Summary

  • synchronize Z-Image sigmas whenever target timesteps are inserted
  • preserve the scheduler invariant timestep = sigma * num_train_timesteps
  • add a CPU regression using the 8-step student and 50-step teacher schedules used by trajectory imitation

TrajectoryImitationLoss asks the teacher schedule to contain each student timestep exactly. The scheduler previously replaced only the timestep value at the nearest teacher slot and left its sigma unchanged. The model was therefore conditioned on the student time while the flow integration still used the old teacher sigma.

For the real 8/50-step schedules, the old mismatch between timestep and sigma * 1000 reached 13.16. Updating both values keeps teacher trajectory states aligned with the student schedule.

Testing

  • python -m pytest tests/test_flow_match.py -q (1 passed)
  • ruff check tests/test_flow_match.py
  • ruff format --check tests/test_flow_match.py

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