Unverified Commit 8da360aa authored by Linoy Tsaban's avatar Linoy Tsaban Committed by GitHub
Browse files

[training scripts] add tags of diffusers-training (#7206)

* add tags for diffusers training

* add tags for diffusers training

* add tags for diffusers training

* add tags for diffusers training

* add tags for diffusers training

* add tags for diffusers training

* add dora tags for drambooth lora scripts

* style
parent 869bad3e
......@@ -77,6 +77,7 @@ logger = get_logger(__name__)
def save_model_card(
repo_id: str,
use_dora: bool,
images=None,
base_model=str,
train_text_encoder=False,
......@@ -88,6 +89,7 @@ def save_model_card(
vae_path=None,
):
img_str = "widget:\n"
lora = "lora" if not use_dora else "dora"
for i, image in enumerate(images):
image.save(os.path.join(repo_folder, f"image_{i}.png"))
img_str += f"""
......@@ -139,9 +141,10 @@ to trigger concept `{key}` → use `{tokens}` in your prompt \n
tags:
- stable-diffusion
- stable-diffusion-diffusers
- diffusers-training
- text-to-image
- diffusers
- lora
- {lora}
- template:sd-lora
{img_str}
base_model: {base_model}
......@@ -1967,6 +1970,7 @@ def main(args):
save_model_card(
model_id if not args.push_to_hub else repo_id,
use_dora=args.use_dora,
images=images,
base_model=args.pretrained_model_name_or_path,
train_text_encoder=args.train_text_encoder,
......
......@@ -81,6 +81,7 @@ logger = get_logger(__name__)
def save_model_card(
repo_id: str,
use_dora: bool,
images=None,
base_model=str,
train_text_encoder=False,
......@@ -92,6 +93,7 @@ def save_model_card(
vae_path=None,
):
img_str = "widget:\n"
lora = "lora" if not use_dora else "dora"
for i, image in enumerate(images):
image.save(os.path.join(repo_folder, f"image_{i}.png"))
img_str += f"""
......@@ -144,9 +146,10 @@ to trigger concept `{key}` → use `{tokens}` in your prompt \n
tags:
- stable-diffusion-xl
- stable-diffusion-xl-diffusers
- diffusers-training
- text-to-image
- diffusers
- lora
- {lora}
- template:sd-lora
{img_str}
base_model: {base_model}
......@@ -2204,6 +2207,7 @@ def main(args):
save_model_card(
model_id if not args.push_to_hub else repo_id,
use_dora=args.use_dora,
images=images,
base_model=args.pretrained_model_name_or_path,
train_text_encoder=args.train_text_encoder,
......
......@@ -242,6 +242,7 @@ These are controlnet weights trained on {base_model} with new type of conditioni
"text-to-image",
"diffusers",
"controlnet",
"diffusers-training",
]
model_card = populate_model_card(model_card, tags=tags)
......
......@@ -169,6 +169,7 @@ These are controlnet weights trained on {base_model} with new type of conditioni
"diffusers",
"controlnet",
"jax-diffusers-event",
"diffusers-training",
]
model_card = populate_model_card(model_card, tags=tags)
......
......@@ -243,6 +243,7 @@ These are controlnet weights trained on {base_model} with new type of conditioni
"text-to-image",
"diffusers",
"controlnet",
"diffusers-training",
]
model_card = populate_model_card(model_card, tags=tags)
......
......@@ -97,7 +97,14 @@ These are Custom Diffusion adaption weights for {base_model}. The weights were t
inference=True,
)
tags = ["text-to-image", "diffusers", "stable-diffusion", "stable-diffusion-diffusers", "custom-diffusion"]
tags = [
"text-to-image",
"diffusers",
"stable-diffusion",
"stable-diffusion-diffusers",
"custom-diffusion",
"diffusers-training",
]
model_card = populate_model_card(model_card, tags=tags)
model_card.save(os.path.join(repo_folder, "README.md"))
......
......@@ -102,7 +102,7 @@ DreamBooth for the text encoder was enabled: {train_text_encoder}.
inference=True,
)
tags = ["text-to-image", "dreambooth"]
tags = ["text-to-image", "dreambooth", "diffusers-training"]
if isinstance(pipeline, StableDiffusionPipeline):
tags.extend(["stable-diffusion", "stable-diffusion-diffusers"])
else:
......
......@@ -106,7 +106,7 @@ LoRA for the text encoder was enabled: {train_text_encoder}.
model_description=model_description,
inference=True,
)
tags = ["text-to-image", "diffusers", "lora"]
tags = ["text-to-image", "diffusers", "lora", "diffusers-training"]
if isinstance(pipeline, StableDiffusionPipeline):
tags.extend(["stable-diffusion", "stable-diffusion-diffusers"])
else:
......
......@@ -96,6 +96,7 @@ def determine_scheduler_type(pretrained_model_name_or_path, revision):
def save_model_card(
repo_id: str,
use_dora: bool,
images=None,
base_model: str = None,
train_text_encoder=False,
......@@ -156,8 +157,9 @@ Please adhere to the licensing terms as described [here](https://huggingface.co/
tags = [
"text-to-image",
"text-to-image",
"diffusers-training",
"diffusers",
"lora",
"lora" if not use_dora else "dora",
"template:sd-lora",
]
if "playgroundai" in base_model:
......@@ -1912,6 +1914,7 @@ def main(args):
if args.push_to_hub:
save_model_card(
repo_id,
use_dora=args.use_dora,
images=images,
base_model=args.pretrained_model_name_or_path,
train_text_encoder=args.train_text_encoder,
......
......@@ -81,6 +81,7 @@ tags:
- kandinsky
- text-to-image
- diffusers
- diffusers-training
inference: true
---
"""
......
......@@ -65,6 +65,7 @@ tags:
- kandinsky
- text-to-image
- diffusers
- diffusers-training
- lora
inference: true
---
......
......@@ -65,6 +65,7 @@ tags:
- kandinsky
- text-to-image
- diffusers
- diffusers-training
- lora
inference: true
---
......
......@@ -82,6 +82,7 @@ tags:
- kandinsky
- text-to-image
- diffusers
- diffusers-training
inference: true
---
"""
......
......@@ -460,6 +460,8 @@ tags:
- text-to-image
- diffusers
- controlnet
- diffusers-training
- webdataset
inference: true
---
"""
......
......@@ -69,6 +69,7 @@ tags:
- stable-diffusion-diffusers
- text-to-image
- diffusers
- diffusers-training
- lora
inference: true
---
......
......@@ -100,6 +100,8 @@ tags:
- text-to-image
- diffusers
- textual_inversion
- diffusers-training
- onxruntime
inference: true
---
"""
......
......@@ -87,6 +87,7 @@ tags:
- text-to-image
- diffusers
- realfill
- diffusers-training
inference: true
---
"""
......
......@@ -225,7 +225,14 @@ These are t2iadapter weights trained on {base_model} with new type of conditioni
inference=True,
)
tags = ["stable-diffusion-xl", "stable-diffusion-xl-diffusers", "text-to-image", "diffusers", "t2iadapter"]
tags = [
"stable-diffusion-xl",
"stable-diffusion-xl-diffusers",
"text-to-image",
"diffusers",
"t2iadapter",
"diffusers-training",
]
model_card = populate_model_card(model_card, tags=tags)
model_card.save(os.path.join(repo_folder, "README.md"))
......
......@@ -131,7 +131,7 @@ More information on all the CLI arguments and the environment are available on y
inference=True,
)
tags = ["stable-diffusion", "stable-diffusion-diffusers", "text-to-image", "diffusers"]
tags = ["stable-diffusion", "stable-diffusion-diffusers", "text-to-image", "diffusers", "diffusers-training"]
model_card = populate_model_card(model_card, tags=tags)
model_card.save(os.path.join(repo_folder, "README.md"))
......
......@@ -90,6 +90,7 @@ These are LoRA adaption weights for {base_model}. The weights were fine-tuned on
"stable-diffusion-diffusers",
"text-to-image",
"diffusers",
"diffusers-training",
"lora",
]
model_card = populate_model_card(model_card, tags=tags)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment