-
Notifications
You must be signed in to change notification settings - Fork 4
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
SD 3.5L Support an Lycoris #3
Comments
Hi Xavier, |
Hi Kliyer, Thank you for your reply. I've been reviewing the code in the repository further and have a few questions:
I look forward to your insights. Thank you for your time, and best of luck with aCVPR! |
(author of ST / simpletuner) also unfamiliar with Hydra, which is the main thing keeping me from implementing LoRAdapter there. the problem isn't that it's impossible to figure out, but that due to the lack of familiarity with Hydra, it will require a fair amount of doc digging and reverse engineering to figure out how the config-driven training is really working here. |
@bghira That problem is relatively easily solved actually. You can just start a training (e.g., with data:
_target_: src.data.local.ImageDataModule
directories:
- data
transform:
- _target_: torchvision.transforms.Resize
size: 512
- _target_: torchvision.transforms.CenterCrop
size: 512
- _target_: torchvision.transforms.ToTensor
- _target_: torchvision.transforms.Normalize
mean:
- 0.5
- 0.5
- 0.5
std:
- 0.5
- 0.5
- 0.5
batch_size: 8
caption_from_name: true
caption_prefix: 'a picture of '
model:
_target_: src.model.SD15
pipeline_type: diffusers.StableDiffusionPipeline
model_name: runwayml/stable-diffusion-v1-5
local_files_only: ${local_files_only}
size: 512
max_train_steps: null
epochs: 10
learning_rate: 0.0001
lr_warmup_steps: 0
lr_scheduler: constant
prompt: null
gradient_accumulation_steps: 1
ckpt_steps: 3000
val_steps: 3000
val_images: 4
seed: 42
n_samples: 4
tag: ''
local_files_only: false
lora:
struct:
mapper_network:
_target_: src.mapper_network.FixedStructureMapper15
c_dim: ${..config.c_dim}
encoder:
_target_: src.annotators.midas.DepthEstimator
model: Intel/dpt-hybrid-midas
size: ${size}
local_files_only: ${local_files_only}
cfg: false
config:
c_dim: 128
rank: 128
adaption_mode: only_res_conv
lora_cls: NewStructLoRAConv
optimize: true
log_c: true
val_batches: 4 This one should be easily interpretable: It's some global config variables that are interpreted by the trainer file, plus direct Python class instanciations (every block with a I hope that at least helps with the question of how config files relate to what happens during training. |
So the main things is: Or is there other special configuration? |
Hi @xavier-airilab,
|
Concretely, the logic for adapting the LoRA to he model architecture is handled here: https://github.com/CompVis/LoRAdapter/blob/main/src/model.py#L139 This loops over all keys of the model's state dict and checks what the current layer is based on the key. Here you would have to add your logic for new models, e.g. if adaption_mode == "my_adaption_mode" and "layer.you.want.to.adapt" in path:
_continue = False |
Thanks you for your answers, I think you gave me enough answer to start, already a lot to check and try with after your replies 😉 |
Hi, I am very interested in your research and would love to test it with the SD3.5L model.
Currently, I’m fine-tuning a large Lycoris LoKr model for that parent and am exploring control solutions. Your approach looks incredibly promising as a unified model handling multiple traits, and I’d also be interested in the possibility of adapting my trained LoKr model into a LoRAdapter if feasible. I have an architecture-focused dataset with specialized conditioning that I believe could yield strong results in architectural scenarios.
My expertise so far is mostly with community tools, but I am eager to learn and actively contribute. Bghira recommended your repository as an ideal solution for my needs, so here I am.
Thank you for your attention, and for all the innovations you and your team have made open-source over the years. I look forward
The text was updated successfully, but these errors were encountered: