Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
+
|
5 |
+
#### Note: This is mainly only useful if you are writing your own fine tuning script. If you just want to run inference, please visit the PhotoMaker model. [TencentARC/PhotoMaker](https://huggingface.co/TencentARC/PhotoMaker)
|
6 |
+
|
7 |
+
These are just chunks of the weights broken out of [TencentARC/PhotoMaker](https://huggingface.co/TencentARC/PhotoMaker) to allow easier fine tuning and loading of the individual pieces.
|
8 |
+
The weights here are identical to the original in every other way.
|
9 |
+
|
10 |
+
The CLIP vision model can be loaded with
|
11 |
+
|
12 |
+
```python
|
13 |
+
image_preprocessor = CLIPImageProcessor.from_pretrained("ostris/photo-maker-face-sdxl")
|
14 |
+
clip_vision = CLIPVisionModelWithProjection.from_pretrained(
|
15 |
+
"ostris/photo-maker-face-sdxl",
|
16 |
+
ignore_mismatched_sizes=True
|
17 |
+
)
|
18 |
+
```
|
19 |
+
It will warn about additional weights because the `fuse_model` and `visual_projection_2` are included in the file but not needed for CLIP.
|
20 |
+
|
21 |
+
Using the included python file (modified only to handle from pretrained for now), the PhotoMakerIDEncoder can be loaded with
|
22 |
+
|
23 |
+
```python
|
24 |
+
id_encoder = PhotoMakerIDEncoder.from_pretrained("ostris/photo-maker-face-sdxl")
|
25 |
+
```
|
26 |
+
|
27 |
+
The fuse weights are included in the vision encoder, but are also seperated out in `pytorch_fuse_module_weights.safetensors` so they can be loaded seperatly if only fine
|
28 |
+
tuning the fuse_module and / or LoRA.
|
29 |
+
|
30 |
+
The LoRA can also be loaded seperatly with standard Diffusers LoRA loading.
|
31 |
+
```python
|
32 |
+
pipeline.load_lora_weights("ostris/photo-maker-face-sdxl", adapter_name="photomaker")
|
33 |
+
```
|
34 |
+
|