kelseye commited on
Commit
59ea5fa
·
verified ·
1 Parent(s): ca106b1

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,15 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ _cover_images_/11_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
37
+ _cover_images_/12_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
38
+ _cover_images_/26_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
39
+ _cover_images_/5_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
40
+ _cover_images_/6_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
41
+ _cover_images_/9_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
42
+ assets/11_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
43
+ assets/12_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
44
+ assets/5.jpg filter=lfs diff=lfs merge=lfs -text
45
+ assets/5_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
46
+ assets/6_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
47
+ assets/9_blingbling.jpg filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+ # Glass Sculpture - Kontext Image Editing LoRA
5
+
6
+ ## Model Introduction
7
+
8
+ This LoRA model is trained based on the [Kontext](https://www.modelscope.cn/models/black-forest-labs/FLUX.1-Kontext-dev) model and [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio). After using this model, you can input the instruction `Transform into a glass sculpture.` to transform the main subject in an image into a sparkling glass sculpture.
9
+
10
+ ## Model Results
11
+
12
+ ||Example 1|Example 2|Example 3|
13
+ |-|-|-|-|
14
+ |Original|![](./assets/9.jpg)|![](./assets/6.jpg)|![](./assets/12.jpg)|
15
+ |Generated|![](./assets/9_blingbling.jpg)|![](./assets/6_blingbling.jpg)|![](./assets/12_blingbling.jpg)|
16
+
17
+ ||Example 4|Example 5|Example 6|
18
+ |-|-|-|-|
19
+ |Original|![](./assets/15.jpg)|![](./assets/5.jpg)|![](./assets/11.jpg)|
20
+ |Generated|![](./assets/15_blingbling.jpg)|![](./assets/5_blingbling.jpg)|![](./assets/11_blingbling.jpg)|
21
+
22
+ ## Usage Instructions
23
+
24
+ This model is trained using the [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio/tree/main/examples/flux) framework. Please install it first:
25
+
26
+ ```
27
+ git clone https://github.com/modelscope/DiffSynth-Studio.git
28
+ cd DiffSynth-Studio
29
+ pip install -e .
30
+ ```
31
+
32
+ ```python
33
+ import torch
34
+ from diffsynth.pipelines.flux_image_new import FluxImagePipeline, ModelConfig
35
+ from PIL import Image
36
+ from modelscope import snapshot_download
37
+
38
+ snapshot_download("DiffSynth-Studio/FLUX.1-Kontext-dev-lora-blingbling", cache_dir="./models")
39
+ pipe = FluxImagePipeline.from_pretrained(
40
+ torch_dtype=torch.bfloat16,
41
+ device="cuda",
42
+ model_configs=[
43
+ ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="flux1-kontext-dev.safetensors"),
44
+ ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder/model.safetensors"),
45
+ ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder_2/"),
46
+ ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="ae.safetensors"),
47
+ ],
48
+ )
49
+ pipe.load_lora(pipe.dit, "models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-blingbling/model.safetensors", alpha=1)
50
+ ```
51
+
52
+ image = Image.open("your_image.jpg")
53
+ image = pipe(
54
+ prompt="Transform into a glass sculpture.",
55
+ kontext_images=image,
56
+ embedded_guidance=2.5,
57
+ seed=0,
58
+ )
59
+ image.save("output.jpg")
60
+ ```
README_from_modelscope.md ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: MusePublic/FLUX.1-Kontext-Dev@v1
3
+ cover_images:
4
+ - _cover_images_/26_blingbling.jpg
5
+ - _cover_images_/9_blingbling.jpg
6
+ - _cover_images_/6_blingbling.jpg
7
+ - _cover_images_/12_blingbling.jpg
8
+ - _cover_images_/15_blingbling.jpg
9
+ - _cover_images_/5_blingbling.jpg
10
+ - _cover_images_/11_blingbling.jpg
11
+ frameworks:
12
+ - Pytorch
13
+ license: Apache License 2.0
14
+ tags:
15
+ - LoRA
16
+ - text-to-image
17
+ tasks:
18
+ - text-to-image-synthesis
19
+ vision_foundation: FLUX_1
20
+
21
+ #model-type:
22
+ ##如 gpt、phi、llama、chatglm、baichuan 等
23
+ #- gpt
24
+
25
+ #domain:
26
+ ##如 nlp、cv、audio、multi-modal
27
+ #- nlp
28
+
29
+ #language:
30
+ ##语言代码列表 https://help.aliyun.com/document_detail/215387.html?spm=a2c4g.11186623.0.0.9f8d7467kni6Aa
31
+ #- cn
32
+
33
+ #metrics:
34
+ ##如 CIDEr、Blue、ROUGE 等
35
+ #- CIDEr
36
+
37
+ #tags:
38
+ ##各种自定义,包括 pretrained、fine-tuned、instruction-tuned、RL-tuned 等训练方法和其他
39
+ #- pretrained
40
+
41
+ #tools:
42
+ ##如 vllm、fastchat、llamacpp、AdaSeq 等
43
+ #- vllm
44
+ ---
45
+
46
+ # 玻璃雕像 - Kontext 图像编辑 LoRA
47
+
48
+ ## 模型介绍
49
+
50
+ 本 LoRA 模型是基于 [Kontext](https://www.modelscope.cn/models/black-forest-labs/FLUX.1-Kontext-dev) 模型和 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) 训练的 LoRA 模型,使用本模型后,可输入指令 `Transform into a glass sculpture.` 将画面中的主体内容转换为晶莹的玻璃雕像。
51
+
52
+ ## 模型效果
53
+
54
+ ||样例 1|样例 2|样例 3|
55
+ |-|-|-|-|
56
+ |原图|![](./assets/9.jpg)|![](./assets/6.jpg)|![](./assets/12.jpg)|
57
+ |生成图|![](./assets/9_blingbling.jpg)|![](./assets/6_blingbling.jpg)|![](./assets/12_blingbling.jpg)|
58
+
59
+ ||样例 4|样例 5|样例 6|
60
+ |-|-|-|-|
61
+ |原图|![](./assets/15.jpg)|![](./assets/5.jpg)|![](./assets/11.jpg)|
62
+ |生成图|![](./assets/15_blingbling.jpg)|![](./assets/5_blingbling.jpg)|![](./assets/11_blingbling.jpg)|
63
+
64
+ ## 使用说明
65
+
66
+ 本模型基于框架 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio/tree/main/examples/flux) 训练,请先安装
67
+
68
+ ```
69
+ git clone https://github.com/modelscope/DiffSynth-Studio.git
70
+ cd DiffSynth-Studio
71
+ pip install -e .
72
+ ```
73
+
74
+ ```python
75
+ import torch
76
+ from diffsynth.pipelines.flux_image_new import FluxImagePipeline, ModelConfig
77
+ from PIL import Image
78
+ from modelscope import snapshot_download
79
+
80
+ snapshot_download("DiffSynth-Studio/FLUX.1-Kontext-dev-lora-blingbling", cache_dir="./models")
81
+ pipe = FluxImagePipeline.from_pretrained(
82
+ torch_dtype=torch.bfloat16,
83
+ device="cuda",
84
+ model_configs=[
85
+ ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="flux1-kontext-dev.safetensors"),
86
+ ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder/model.safetensors"),
87
+ ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder_2/"),
88
+ ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="ae.safetensors"),
89
+ ],
90
+ )
91
+ pipe.load_lora(pipe.dit, "models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-blingbling/model.safetensors", alpha=1)
92
+
93
+ image = Image.open("your_image.jpg")
94
+ image = pipe(
95
+ prompt="Transform into a glass sculpture.",
96
+ kontext_images=image,
97
+ embedded_guidance=2.5,
98
+ seed=0,
99
+ )
100
+ image.save("output.jpg")
101
+ ```
_cover_images_/11_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 0c5bfb441fc85ecf91feae37a9b01abd25b435b5922c1c910c201cb34f2e214a
  • Pointer size: 131 Bytes
  • Size of remote file: 136 kB
_cover_images_/12_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 3b4ea208e273b72b30033f209bc44c88fe65d0c57dee4f52353978900e9e6932
  • Pointer size: 131 Bytes
  • Size of remote file: 116 kB
_cover_images_/15_blingbling.jpg ADDED
_cover_images_/26_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 972dcd192b4768948be74911da9ed3d69f39a7318d74d0fca17eb7f5af343627
  • Pointer size: 131 Bytes
  • Size of remote file: 120 kB
_cover_images_/5_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 17f7c88f528999b4cf565539c1e726108f667891c6ed0113f0e20e4f1e9c1b1e
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB
_cover_images_/6_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 8b0ad473eb3d27f1716927cbb029fa0a6a081f8164dcd991281ee8dd7cd51d6d
  • Pointer size: 131 Bytes
  • Size of remote file: 107 kB
_cover_images_/9_blingbling.jpg ADDED

Git LFS Details

  • SHA256: ab10949ad2693a2783b67b16e807f65e962de9098139e9658b3c4c13e8e71018
  • Pointer size: 131 Bytes
  • Size of remote file: 126 kB
assets/11.jpg ADDED
assets/11_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 0c5bfb441fc85ecf91feae37a9b01abd25b435b5922c1c910c201cb34f2e214a
  • Pointer size: 131 Bytes
  • Size of remote file: 136 kB
assets/12.jpg ADDED
assets/12_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 3b4ea208e273b72b30033f209bc44c88fe65d0c57dee4f52353978900e9e6932
  • Pointer size: 131 Bytes
  • Size of remote file: 116 kB
assets/15.jpg ADDED
assets/15_blingbling.jpg ADDED
assets/5.jpg ADDED

Git LFS Details

  • SHA256: 137eff6829823e265d7b6caa7a5b1b0d7a295341b6f3ab93d43eefa2a9768e37
  • Pointer size: 131 Bytes
  • Size of remote file: 107 kB
assets/5_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 17f7c88f528999b4cf565539c1e726108f667891c6ed0113f0e20e4f1e9c1b1e
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB
assets/6.jpg ADDED
assets/6_blingbling.jpg ADDED

Git LFS Details

  • SHA256: 8b0ad473eb3d27f1716927cbb029fa0a6a081f8164dcd991281ee8dd7cd51d6d
  • Pointer size: 131 Bytes
  • Size of remote file: 107 kB
assets/9.jpg ADDED
assets/9_blingbling.jpg ADDED

Git LFS Details

  • SHA256: ab10949ad2693a2783b67b16e807f65e962de9098139e9658b3c4c13e8e71018
  • Pointer size: 131 Bytes
  • Size of remote file: 126 kB
configuration.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "aigc_model": true,
3
+ "model_file_location": "model.safetensors",
4
+ "framework": "Pytorch",
5
+ "task": "other"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:664138a821949be778916b1716079b55663d29c4a585746446bb9f838d316c5b
3
+ size 306423688