You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add draft for lora text encoder scale
* Improve naming
* fix: training dreambooth lora script.
* Apply suggestions from code review
* Update examples/dreambooth/train_dreambooth_lora.py
* Apply suggestions from code review
* Apply suggestions from code review
* add lora mixin when fit
* add lora mixin when fit
* add lora mixin when fit
* fix more
* fix more
---------
Co-authored-by: Sayak Paul <[email protected]>
"`use_safetensors`=True but safetensors is not installed. Please install safetensors with `pip install safetenstors"
@@ -953,6 +956,12 @@ def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Union[str, Di
953
956
warn_message="You have saved the LoRA weights using the old format. To convert the old LoRA weights to the new format, you can first load them in a dictionary and then create a new dictionary like the following: `new_state_dict = {f'unet'.{module_name}: params for module_name, params in old_state_dict.items()}`."
954
957
warnings.warn(warn_message)
955
958
959
+
@property
960
+
deflora_scale(self) ->float:
961
+
# property function that returns the lora scale which can be set at run time by the pipeline.
Copy file name to clipboardExpand all lines: pipelines/alt_diffusion/pipeline_alt_diffusion.py
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@
24
24
25
25
from ...configuration_utilsimportFrozenDict
26
26
from ...image_processorimportVaeImageProcessor
27
-
from ...loadersimportTextualInversionLoaderMixin
27
+
from ...loadersimportLoraLoaderMixin, TextualInversionLoaderMixin
28
28
from ...modelsimportAutoencoderKL, UNet2DConditionModel
29
29
from ...schedulersimportKarrasDiffusionSchedulers
30
30
from ...utilsimportdeprecate, logging, randn_tensor, replace_example_docstring
@@ -52,7 +52,7 @@
52
52
53
53
54
54
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline with Stable->Alt, CLIPTextModel->RobertaSeriesModelWithTransformation, CLIPTokenizer->XLMRobertaTokenizer, AltDiffusionSafetyChecker->StableDiffusionSafetyChecker
Copy file name to clipboardExpand all lines: pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@
26
26
27
27
from ...configuration_utilsimportFrozenDict
28
28
from ...image_processorimportVaeImageProcessor
29
-
from ...loadersimportTextualInversionLoaderMixin
29
+
from ...loadersimportLoraLoaderMixin, TextualInversionLoaderMixin
30
30
from ...modelsimportAutoencoderKL, UNet2DConditionModel
31
31
from ...schedulersimportKarrasDiffusionSchedulers
32
32
from ...utilsimportPIL_INTERPOLATION, deprecate, logging, randn_tensor, replace_example_docstring
@@ -95,7 +95,7 @@ def preprocess(image):
95
95
96
96
97
97
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_img2img.StableDiffusionImg2ImgPipeline with Stable->Alt, CLIPTextModel->RobertaSeriesModelWithTransformation, CLIPTokenizer->XLMRobertaTokenizer, AltDiffusionSafetyChecker->StableDiffusionSafetyChecker
0 commit comments