SurenaSa commited on
Commit
0e71da5
·
verified ·
1 Parent(s): 7900b08

Training run: 64 rank, Feed-Forward targets

Browse files
Files changed (3) hide show
  1. README.md +50 -0
  2. adapter_config.json +38 -0
  3. adapter_model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: lambdalabs/miniSD-diffusers
4
+ tags:
5
+ - stable-diffusion
6
+ - lora
7
+ - diffusers
8
+ - concept-swap
9
+ ---
10
+
11
+ # Giraffe-Zebra Concept Swap LoRA
12
+
13
+ This LoRA adapter swaps the concepts of giraffes and zebras in Stable Diffusion.
14
+
15
+ ## Training Details
16
+ - Base Model: lambdalabs/miniSD-diffusers
17
+ - LoRA Rank: 64
18
+ - Training Epochs: 30
19
+ - Learning Rate: 0.0002
20
+
21
+ ## Usage
22
+ ```python
23
+ from diffusers import StableDiffusionPipeline
24
+ from peft import PeftModel
25
+ import torch
26
+
27
+ # Load base model
28
+ pipe = StableDiffusionPipeline.from_pretrained(
29
+ "lambdalabs/miniSD-diffusers",
30
+ torch_dtype=torch.float16
31
+ )
32
+
33
+ # Load LoRA weights
34
+ pipe.unet = PeftModel.from_pretrained(
35
+ pipe.unet,
36
+ "SurenaSa/IOAI2024_CV_Problem_V6_LoRA",
37
+ is_trainable=False
38
+ )
39
+
40
+ pipe.to("cuda")
41
+
42
+ # Generate
43
+ prompt = "a photo of a giraffe" # Will generate a zebra!
44
+ image = pipe(prompt, num_inference_steps=30, guidance_scale=7.5).images[0]
45
+ image.save("output.png")
46
+ ```
47
+
48
+ ## Examples
49
+ - Prompt: "a photo of a giraffe" → Generates zebra
50
+ - Prompt: "a photo of a zebra" → Generates giraffe
adapter_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": {
4
+ "base_model_class": "UNet2DConditionModel",
5
+ "parent_library": "diffusers.models.unets.unet_2d_condition"
6
+ },
7
+ "base_model_name_or_path": "lambdalabs/miniSD-diffusers",
8
+ "bias": "none",
9
+ "fan_in_fan_out": false,
10
+ "inference_mode": true,
11
+ "init_lora_weights": true,
12
+ "layer_replication": null,
13
+ "layers_pattern": null,
14
+ "layers_to_transform": null,
15
+ "loftq_config": {},
16
+ "lora_alpha": 64,
17
+ "lora_dropout": 0.0,
18
+ "megatron_config": null,
19
+ "megatron_core": "megatron.core",
20
+ "modules_to_save": null,
21
+ "peft_type": "LORA",
22
+ "r": 64,
23
+ "rank_pattern": {},
24
+ "revision": null,
25
+ "target_modules": [
26
+ "proj_out",
27
+ "to_out.0",
28
+ "ff.net.2",
29
+ "proj_in",
30
+ "to_q",
31
+ "to_k",
32
+ "to_v",
33
+ "ff.net.0.proj"
34
+ ],
35
+ "task_type": null,
36
+ "use_dora": false,
37
+ "use_rslora": false
38
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03dc0b654407100b771274b0e3ee87ad399455a224efae76a79eff896361eaae
3
+ size 108587728