-
Notifications
You must be signed in to change notification settings - Fork 116
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
Each pipe run generates different image (run with the same params and seed) #1087
Comments
Have you try the native API of diffusers to load and fuse lora? |
Yes, it crashes. @strint changed to
errorRuntimeError Traceback (most recent call last) RuntimeError: super(): class cell not found During handling of the above exception, another exception occurred: AttributeError Traceback (most recent call last) Cell In[2], line 52, in main(pipe, checkpoint, iteration_number) File /api/.venv/lib/python3.10/site-packages/diffusers/loaders/lora.py:1234, in StableDiffusionXLLoraLoaderMixin.load_lora_weights(self, pretrained_model_name_or_path_or_dict, adapter_name, **kwargs) File /api/.venv/lib/python3.10/site-packages/diffusers/loaders/lora.py:401, in LoraLoaderMixin.load_lora_into_unet(cls, state_dict, network_alphas, unet, adapter_name, _pipeline) File /api/.venv/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:114, in validate_hf_hub_args.._inner_fn(*args, **kwargs) File /api/.venv/lib/python3.10/site-packages/diffusers/loaders/unet.py:217, in UNet2DConditionLoadersMixin.load_attn_procs(self, pretrained_model_name_or_path_or_dict, **kwargs) File /api/.venv/lib/python3.10/site-packages/diffusers/loaders/unet.py:350, in UNet2DConditionLoadersMixin._process_lora(self, state_dict, unet_identifier_key, network_alphas, adapter_name, _pipeline) File /api/.venv/lib/python3.10/site-packages/peft/mapping.py:215, in inject_adapter_in_model(peft_config, model, adapter_name) File /api/.venv/lib/python3.10/site-packages/peft/tuners/lora/model.py:139, in LoraModel.init(self, model, config, adapter_name) File /api/.venv/lib/python3.10/site-packages/peft/tuners/tuners_utils.py:175, in BaseTuner.init(self, model, peft_config, adapter_name) File /api/.venv/lib/python3.10/site-packages/peft/tuners/tuners_utils.py:431, in BaseTuner.inject_adapter(self, model, adapter_name, autocast_adapter_dtype) File /api/.venv/lib/python3.10/site-packages/peft/tuners/lora/model.py:214, in LoraModel._create_and_replace(self, lora_config, adapter_name, target, target_name, parent, current_key) File /api/.venv/lib/python3.10/site-packages/peft/tuners/lora/layer.py:109, in LoraLayer.update_layer(self, adapter_name, r, lora_alpha, lora_dropout, init_lora_weights, use_rslora, use_dora) File /api/.venv/lib/python3.10/site-packages/onediff/infer_compiler/backends/oneflow/dual_module.py:89, in DualModule.getattr(self, name) File /api/.venv/lib/python3.10/site-packages/onediff/infer_compiler/backends/oneflow/transform/builtin_transform.py:238, in _..proxy_getattr(self, attr) File /api/.venv/lib/python3.10/site-packages/onediff/infer_compiler/backends/oneflow/transform/builtin_transform.py:129, in ProxySubmodule.getattribute(self, attribute) File /api/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py:1729, in Module.getattr(self, name) AttributeError: 'Linear' object has no attribute 'r' |
Your current environment information
onediff = "1.2.0"
oneflow = { version = "0.9.1.dev.20240510", source = "oneflow_source" }
onediffx = "1.2.0"
🐛 Describe the bug
Each pipe run using onediffx generates different image when using exactly the same params and seed.
Example code:
The images I got:
There are differences between these two images that expected to be the same. Another way to see the difference, by minus between this 2 images, the result isn't black as expected -
I checked the code without loading lora and the generated images are exactly the same. So as I see it the problem appears at "load_and_fuse_lora" function.
The text was updated successfully, but these errors were encountered: