Skip to content

[Question] Consistent leftward spatial drift in Qwen-Image-2.1 editing after 4-step CDM distillation #13

Open

Description

@racso10

Hi, thank you for sharing your work on CDM. I’m adapting it to Qwen-Image-2.1 for image editing with a single reference image and a text prompt, and I would be grateful for your advice on an issue I’ve encountered.

After approximately 2,000 training iterations, the distilled 4-step LoRA produces edited images that are consistently shifted substantially to the left relative to the reference image. The shift affects even regions that should remain unchanged, and similar drift is visible in the training previews.

  1. Have you observed consistent directional spatial drift when applying DDM/CDM distillation to image editing? Are there settings for trajectory_eps, the re-noising strategy, or the random rollout length that work particularly well for image-to-image editing?

  2. When adapting a model with KV caching, such as Qwen-Image-2.1, to CDM, I recompute the conditioning-prefix keys and values for each gradient-enabled training forward pass. Are there other implementation details I should check carefully?

I would greatly appreciate any suggestions on possible causes or training settings to try. Thank you for your time and help!

Activity

  1. xuchunGao commented on Sep 28, 2026

    @xuchunGao

    Hi, thank you for sharing your work on CDM. I’m adapting it to Qwen-Image-2.1 for image editing with a single reference image and a text prompt, and I would be grateful for your advice on an issue I’ve encountered.

    After approximately 2,000 training iterations, the distilled 4-step LoRA produces edited images that are consistently shifted substantially to the left relative to the reference image. The shift affects even regions that should remain unchanged, and similar drift is visible in the training previews.

    1. Have you observed consistent directional spatial drift when applying DDM/CDM distillation to image editing? Are there settings for trajectory_eps, the re-noising strategy, or the random rollout length that work particularly well for image-to-image editing?
    2. When adapting a model with KV caching, such as Qwen-Image-2.1, to CDM, I recompute the conditioning-prefix keys and values for each gradient-enabled training forward pass. Are there other implementation details I should check carefully?

    I would greatly appreciate any suggestions on possible causes or training settings to try. Thank you for your time and help!

    我也遇到了这个现象,可以检查一下出现左移部分开始时的训练数据,我发现如果数据的提示要求大位移,特别是集中训练大位移的数据,会导致正常提示词的生成出现图像大的位移,整个模型的分布塌缩了,可以参考一下Qwen-Flash的技术报告,里面有数据的配比相关的研究。

  2. byliutao commented on Oct 13, 2026

    @byliutao
    Owner

    Thank you for your interest in our work, and thanks to @xuchunGao for the explanation. Spatial drift is a fairly common issue in DMD distillation, and we have observed similar behavior in experiments with other models. Also, the hyperparameters in the repository are tuned for text-to-image tasks and may not be optimal for image editing.
    Regarding spatial drift, we have three observations:

    1. As @xuchunGao mentioned, the training data matters a lot. When working on some particularly text editing tasks, we found that fine-tuning on data from those tasks alone was insufficient to preserve the model’s behavior. We needed to mix in a substantial proportion of general-purpose data to stabilize training.
    2. Spatial drift often occurs when the fake score model collapses first, followed by the student. Keeping the fake score model’s updates stable is therefore very important. You could try substantially lowering the fakescore learning rate.
    3. An additional GAN loss can help mitigate drift under the DMD loss. In our experiments, combining the GAN loss with DMD also produced better overall results than training with DMD alone.

    Regarding your second question, for models with KV caching, a useful practice is to align the student’s inference pipeline fully with the official implement code, while computing both the fake score and real score using full attention. This keeps the implementation relatively simple, and full attention in the teacher may also provide stronger guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions