Upload folder using huggingface_hub
Browse files- .gitattributes +12 -0
- README.md +60 -0
- README_from_modelscope.md +101 -0
- _cover_images_/11_blingbling.jpg +3 -0
- _cover_images_/12_blingbling.jpg +3 -0
- _cover_images_/15_blingbling.jpg +0 -0
- _cover_images_/26_blingbling.jpg +3 -0
- _cover_images_/5_blingbling.jpg +3 -0
- _cover_images_/6_blingbling.jpg +3 -0
- _cover_images_/9_blingbling.jpg +3 -0
- assets/11.jpg +0 -0
- assets/11_blingbling.jpg +3 -0
- assets/12.jpg +0 -0
- assets/12_blingbling.jpg +3 -0
- assets/15.jpg +0 -0
- assets/15_blingbling.jpg +0 -0
- assets/5.jpg +3 -0
- assets/5_blingbling.jpg +3 -0
- assets/6.jpg +0 -0
- assets/6_blingbling.jpg +3 -0
- assets/9.jpg +0 -0
- assets/9_blingbling.jpg +3 -0
- configuration.json +6 -0
- model.safetensors +3 -0
.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||||
|
| 15 |
+
|Generated||||
|
| 16 |
+
|
| 17 |
+
||Example 4|Example 5|Example 6|
|
| 18 |
+
|-|-|-|-|
|
| 19 |
+
|Original||||
|
| 20 |
+
|Generated||||
|
| 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 |
+
|原图||||
|
| 57 |
+
|生成图||||
|
| 58 |
+
|
| 59 |
+
||样例 4|样例 5|样例 6|
|
| 60 |
+
|-|-|-|-|
|
| 61 |
+
|原图||||
|
| 62 |
+
|生成图||||
|
| 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
|
_cover_images_/12_blingbling.jpg
ADDED
|
Git LFS Details
|
_cover_images_/15_blingbling.jpg
ADDED
|
_cover_images_/26_blingbling.jpg
ADDED
|
Git LFS Details
|
_cover_images_/5_blingbling.jpg
ADDED
|
Git LFS Details
|
_cover_images_/6_blingbling.jpg
ADDED
|
Git LFS Details
|
_cover_images_/9_blingbling.jpg
ADDED
|
Git LFS Details
|
assets/11.jpg
ADDED
|
assets/11_blingbling.jpg
ADDED
|
Git LFS Details
|
assets/12.jpg
ADDED
|
assets/12_blingbling.jpg
ADDED
|
Git LFS Details
|
assets/15.jpg
ADDED
|
assets/15_blingbling.jpg
ADDED
|
assets/5.jpg
ADDED
|
Git LFS Details
|
assets/5_blingbling.jpg
ADDED
|
Git LFS Details
|
assets/6.jpg
ADDED
|
assets/6_blingbling.jpg
ADDED
|
Git LFS Details
|
assets/9.jpg
ADDED
|
assets/9_blingbling.jpg
ADDED
|
Git LFS Details
|
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
|