Issue due to change of scheduler from FlowMatchEulerDiscreteScheduler to UniPCMultistepScheduler.
I have been getting this error since yesterday:
Traceback (most recent call last):
File "/mnt/data/om/SimpleTuner/inference_hidream.py", line 91, in
image = pipeline(
^^^^^^^^^
File "/mnt/data/om/miniconda3/envs/simpletuner/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/data/om/SimpleTuner/helpers/models/hidream/pipeline.py", line 1003, in call
timesteps, num_inference_steps = retrieve_timesteps(
^^^^^^^^^^^^^^^^^^^
File "/mnt/data/om/SimpleTuner/helpers/models/hidream/pipeline.py", line 120, in retrieve_timesteps
scheduler.set_timesteps(num_inference_steps, device=device, **kwargs)
TypeError: UniPCMultistepScheduler.set_timesteps() got an unexpected keyword argument 'mu'
It turns out that the argument mu is hardcoded in the pipeline, which is not accepted by UniPC, which is why the error is.
https://github.com/HiDream-ai/HiDream-I1/blob/f418a4b13bc548b177aced3880b7294d04594651/hi_diffusers/pipelines/hidream_image/pipeline_hidream_image.py#L637
This is the change made in the repo: https://huggingface.co/HiDream-ai/HiDream-I1-Full/commit/8daf13a8c0d167c9a48a8040b3d2aaba7113de2e#d2h-944196
Sorry for the inconvenience caused. Recently, we updated the scheduler configuration in our Hugging Face model repositories to make it easier to perform inference directly using the Diffusers HiDreamImagePipeline.from_pretrained() method. This change allows the scheduler to be constructed internally within the pipeline, so there is no longer a need to manually instantiate and pass it in externally.
However, this update does not affect users who follow the inference procedure strictly as described in the inference.py script in our GitHub repository. That script uses our custom implementation of the pipeline
and explicitly constructs the scheduler with FlowUniPCMultistepScheduler
from our GitHub codebase, not from the Diffusers library.
From your error message, it looks like you're using UniPCMultistepScheduler from Diffusers, while the pipeline code of SimpleTuner comes from our GitHub repository. This causes an incompatibility due to differences in scheduler structure and usage.
To fix this, we recommend adding the following snippet around line 1001 in SimpleTuner/helpers/models/hidream/pipeline.py:
elif isinstance(self.scheduler, UniPCMultistepScheduler):
self.scheduler.set_timesteps(num_inference_steps, device=device) # , shift=math.exp(mu))
timesteps = self.scheduler.timesteps
We’ll also submit a PR to SimpleTuner shortly to address this conflict properly.