Add Krea-2 Anythng Controlnet.
Browse files- README.md +1 -0
- app.py +4 -1
- core/pipelines/pipeline_input_processor.py +32 -27
- core/settings.py +2 -2
- ui/events/chain_handlers.py +7 -7
- ui/layout.py +1 -1
- ui/shared/ui_components.py +6 -7
- utils/app_utils.py +38 -34
- yaml/chain_features.yaml +13 -12
- yaml/constants.yaml +1 -1
- yaml/file_list.yaml +4 -0
- yaml/krea2_controlnet_models.yaml +3 -0
- yaml/model_defaults.yaml +196 -4
README.md
CHANGED
|
@@ -116,6 +116,7 @@ models:
|
|
| 116 |
- stabilityai/stable-diffusion-3.5-controlnets
|
| 117 |
- stabilityai/stable-diffusion-xl-base-1.0
|
| 118 |
- stable-diffusion-v1-5/stable-diffusion-v1-5
|
|
|
|
| 119 |
- tsukiyomi/krea2_raw-nvfp4
|
| 120 |
- Wenaka/NoobAI_XL_Inpainting_ControlNet_Full
|
| 121 |
- xinsir/anime-painter
|
|
|
|
| 116 |
- stabilityai/stable-diffusion-3.5-controlnets
|
| 117 |
- stabilityai/stable-diffusion-xl-base-1.0
|
| 118 |
- stable-diffusion-v1-5/stable-diffusion-v1-5
|
| 119 |
+
- tori29umai/krea2-controlnet
|
| 120 |
- tsukiyomi/krea2_raw-nvfp4
|
| 121 |
- Wenaka/NoobAI_XL_Inpainting_ControlNet_Full
|
| 122 |
- xinsir/anime-painter
|
app.py
CHANGED
|
@@ -2,6 +2,9 @@ import spaces
|
|
| 2 |
import os
|
| 3 |
import sys
|
| 4 |
import site
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
if "--use-sage-attention" not in sys.argv:
|
| 7 |
sys.argv.append("--use-sage-attention")
|
|
@@ -94,5 +97,5 @@ def create_app():
|
|
| 94 |
demo = create_app()
|
| 95 |
|
| 96 |
if __name__ == "__main__":
|
| 97 |
-
print("--- Launching Gradio Interface ---")
|
| 98 |
demo.queue().launch(mcp_server=True, footer_links=["api", "gradio", "settings"])
|
|
|
|
| 2 |
import os
|
| 3 |
import sys
|
| 4 |
import site
|
| 5 |
+
import gradio as gr
|
| 6 |
+
|
| 7 |
+
print(f"📦 [Environment] Gradio Version: {gr.__version__}")
|
| 8 |
|
| 9 |
if "--use-sage-attention" not in sys.argv:
|
| 10 |
sys.argv.append("--use-sage-attention")
|
|
|
|
| 97 |
demo = create_app()
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
+
print(f"--- Launching Gradio Interface (v{gr.__version__}) ---")
|
| 101 |
demo.queue().launch(mcp_server=True, footer_links=["api", "gradio", "settings"])
|
core/pipelines/pipeline_input_processor.py
CHANGED
|
@@ -65,14 +65,19 @@ def process_pipeline_inputs(ui_inputs: Dict[str, Any], progress: gr.Progress, wo
|
|
| 65 |
for i, (source, lora_id, scale, _) in enumerate(zip(sources, ids, scales, files)):
|
| 66 |
if scale > 0 and lora_id and lora_id.strip():
|
| 67 |
lora_filename = None
|
| 68 |
-
if source
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 71 |
if not os.path.exists(local_path):
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
elif source in ("Civitai", "Hugging Face"):
|
| 74 |
local_path, status = get_lora_path(source, lora_id, os.environ.get("CIVITAI_API_KEY", ""), progress)
|
| 75 |
-
if local_path: lora_filename = os.path.
|
| 76 |
else: raise gr.Error(f"Failed to prepare LoRA {lora_id}: {status}")
|
| 77 |
|
| 78 |
if lora_filename:
|
|
@@ -151,24 +156,18 @@ def process_pipeline_inputs(ui_inputs: Dict[str, Any], progress: gr.Progress, wo
|
|
| 151 |
temp_files_to_clean.append(temp_file_path)
|
| 152 |
|
| 153 |
embedding_data = ui_inputs.get('embedding_data', [])
|
| 154 |
-
embedding_filenames = []
|
| 155 |
if 'embedding' in enabled_chains and embedding_data:
|
| 156 |
emb_sources, emb_ids, emb_files = embedding_data[0::3], embedding_data[1::3], embedding_data[2::3]
|
| 157 |
for i, (source, emb_id, _) in enumerate(zip(emb_sources, emb_ids, emb_files)):
|
| 158 |
if emb_id and emb_id.strip():
|
| 159 |
-
|
| 160 |
-
if source == "File":
|
| 161 |
-
emb_filename = sanitize_filename(emb_id)
|
| 162 |
-
local_path = os.path.join(EMBEDDING_DIR, emb_filename)
|
| 163 |
-
if not os.path.exists(local_path):
|
| 164 |
-
raise gr.Error(f"Uploaded Embedding file '{emb_id}' no longer exists on server. Please re-upload it.")
|
| 165 |
-
elif source in ("Civitai", "Hugging Face"):
|
| 166 |
local_path, status = get_embedding_path(source, emb_id, os.environ.get("CIVITAI_API_KEY", ""), progress)
|
| 167 |
-
if
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
| 172 |
|
| 173 |
controlnet_data = ui_inputs.get('controlnet_data', [])
|
| 174 |
active_controlnets = []
|
|
@@ -427,16 +426,22 @@ def process_pipeline_inputs(ui_inputs: Dict[str, Any], progress: gr.Progress, wo
|
|
| 427 |
vae_source = ui_inputs.get('vae_source')
|
| 428 |
vae_id = ui_inputs.get('vae_id')
|
| 429 |
vae_name_override = None
|
| 430 |
-
if 'vae' in enabled_chains and vae_source and
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
|
|
|
|
|
|
| 434 |
if not os.path.exists(local_path):
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 440 |
if vae_name_override:
|
| 441 |
ui_inputs['vae_name'] = vae_name_override
|
| 442 |
|
|
|
|
| 65 |
for i, (source, lora_id, scale, _) in enumerate(zip(sources, ids, scales, files)):
|
| 66 |
if scale > 0 and lora_id and lora_id.strip():
|
| 67 |
lora_filename = None
|
| 68 |
+
if source in ("Upload File", "File"):
|
| 69 |
+
raw_id = lora_id.strip().replace('\\', '/')
|
| 70 |
+
rel_name = raw_id if raw_id.startswith("upload_file/") else f"upload_file/{raw_id}"
|
| 71 |
+
local_path = os.path.join(LORA_DIR, rel_name)
|
| 72 |
if not os.path.exists(local_path):
|
| 73 |
+
if os.path.exists(os.path.join(LORA_DIR, raw_id)):
|
| 74 |
+
local_path = os.path.join(LORA_DIR, raw_id)
|
| 75 |
+
else:
|
| 76 |
+
raise gr.Error(f"Uploaded LoRA file '{lora_id}' no longer exists on server. Please re-upload it.")
|
| 77 |
+
lora_filename = os.path.relpath(local_path, LORA_DIR).replace('\\', '/')
|
| 78 |
elif source in ("Civitai", "Hugging Face"):
|
| 79 |
local_path, status = get_lora_path(source, lora_id, os.environ.get("CIVITAI_API_KEY", ""), progress)
|
| 80 |
+
if local_path: lora_filename = os.path.relpath(local_path, LORA_DIR).replace('\\', '/')
|
| 81 |
else: raise gr.Error(f"Failed to prepare LoRA {lora_id}: {status}")
|
| 82 |
|
| 83 |
if lora_filename:
|
|
|
|
| 156 |
temp_files_to_clean.append(temp_file_path)
|
| 157 |
|
| 158 |
embedding_data = ui_inputs.get('embedding_data', [])
|
|
|
|
| 159 |
if 'embedding' in enabled_chains and embedding_data:
|
| 160 |
emb_sources, emb_ids, emb_files = embedding_data[0::3], embedding_data[1::3], embedding_data[2::3]
|
| 161 |
for i, (source, emb_id, _) in enumerate(zip(emb_sources, emb_ids, emb_files)):
|
| 162 |
if emb_id and emb_id.strip():
|
| 163 |
+
if source in ("Civitai", "Hugging Face"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
local_path, status = get_embedding_path(source, emb_id, os.environ.get("CIVITAI_API_KEY", ""), progress)
|
| 165 |
+
if not local_path:
|
| 166 |
+
raise gr.Error(f"Failed to prepare Embedding {emb_id}: {status}")
|
| 167 |
+
elif source in ("Upload File", "File"):
|
| 168 |
+
# Uploaded file is already stored in models/embeddings/upload_file/.
|
| 169 |
+
# Embeddings are triggered directly via prompt (e.g. embedding:upload_file/<filename>).
|
| 170 |
+
pass
|
| 171 |
|
| 172 |
controlnet_data = ui_inputs.get('controlnet_data', [])
|
| 173 |
active_controlnets = []
|
|
|
|
| 426 |
vae_source = ui_inputs.get('vae_source')
|
| 427 |
vae_id = ui_inputs.get('vae_id')
|
| 428 |
vae_name_override = None
|
| 429 |
+
if 'vae' in enabled_chains and vae_source and vae_id and str(vae_id).strip():
|
| 430 |
+
vae_id_clean = str(vae_id).strip()
|
| 431 |
+
if vae_source in ("Upload File", "File"):
|
| 432 |
+
raw_id = vae_id_clean.replace('\\', '/')
|
| 433 |
+
rel_name = raw_id if raw_id.startswith("upload_file/") else f"upload_file/{raw_id}"
|
| 434 |
+
local_path = os.path.join(VAE_DIR, rel_name)
|
| 435 |
if not os.path.exists(local_path):
|
| 436 |
+
if os.path.exists(os.path.join(VAE_DIR, raw_id)):
|
| 437 |
+
local_path = os.path.join(VAE_DIR, raw_id)
|
| 438 |
+
else:
|
| 439 |
+
raise gr.Error(f"Uploaded VAE file '{vae_id_clean}' no longer exists on server. Please re-upload it.")
|
| 440 |
+
vae_name_override = os.path.relpath(local_path, VAE_DIR).replace('\\', '/')
|
| 441 |
+
elif vae_source in ("Civitai", "Hugging Face"):
|
| 442 |
+
local_path, status = get_vae_path(vae_source, vae_id_clean, os.environ.get("CIVITAI_API_KEY", ""), progress)
|
| 443 |
+
if local_path: vae_name_override = os.path.relpath(local_path, VAE_DIR).replace('\\', '/')
|
| 444 |
+
else: raise gr.Error(f"Failed to prepare VAE {vae_id_clean}: {status}")
|
| 445 |
if vae_name_override:
|
| 446 |
ui_inputs['vae_name'] = vae_name_override
|
| 447 |
|
core/settings.py
CHANGED
|
@@ -198,7 +198,7 @@ try:
|
|
| 198 |
MAX_CONDITIONINGS = _constants.get('MAX_CONDITIONINGS', 10)
|
| 199 |
MAX_CONTROLNETS = _constants.get('MAX_CONTROLNETS', 5)
|
| 200 |
MAX_IPADAPTERS = _constants.get('MAX_IPADAPTERS', 5)
|
| 201 |
-
LORA_SOURCE_CHOICES = _constants.get('LORA_SOURCE_CHOICES', ["Civitai", "File"])
|
| 202 |
RESOLUTION_MAP = _constants.get('RESOLUTION_MAP', {})
|
| 203 |
MULTIPLIERS_MAP = _constants.get('MULTIPLIERS_MAP', {})
|
| 204 |
ARCHITECTURES_CONFIG = load_architectures_config()
|
|
@@ -208,7 +208,7 @@ try:
|
|
| 208 |
except Exception as e:
|
| 209 |
print(f"FATAL: Could not load constants from YAML. Error: {e}")
|
| 210 |
MAX_LORAS, MAX_EMBEDDINGS, MAX_CONDITIONINGS, MAX_CONTROLNETS, MAX_IPADAPTERS = 5, 5, 10, 5, 5
|
| 211 |
-
LORA_SOURCE_CHOICES = ["Civitai", "File"]
|
| 212 |
RESOLUTION_MAP = {}
|
| 213 |
MULTIPLIERS_MAP = {}
|
| 214 |
ARCHITECTURES_CONFIG = {}
|
|
|
|
| 198 |
MAX_CONDITIONINGS = _constants.get('MAX_CONDITIONINGS', 10)
|
| 199 |
MAX_CONTROLNETS = _constants.get('MAX_CONTROLNETS', 5)
|
| 200 |
MAX_IPADAPTERS = _constants.get('MAX_IPADAPTERS', 5)
|
| 201 |
+
LORA_SOURCE_CHOICES = _constants.get('LORA_SOURCE_CHOICES', ["Civitai", "Hugging Face", "Upload File"])
|
| 202 |
RESOLUTION_MAP = _constants.get('RESOLUTION_MAP', {})
|
| 203 |
MULTIPLIERS_MAP = _constants.get('MULTIPLIERS_MAP', {})
|
| 204 |
ARCHITECTURES_CONFIG = load_architectures_config()
|
|
|
|
| 208 |
except Exception as e:
|
| 209 |
print(f"FATAL: Could not load constants from YAML. Error: {e}")
|
| 210 |
MAX_LORAS, MAX_EMBEDDINGS, MAX_CONDITIONINGS, MAX_CONTROLNETS, MAX_IPADAPTERS = 5, 5, 10, 5, 5
|
| 211 |
+
LORA_SOURCE_CHOICES = ["Civitai", "Hugging Face", "Upload File"]
|
| 212 |
RESOLUTION_MAP = {}
|
| 213 |
MULTIPLIERS_MAP = {}
|
| 214 |
ARCHITECTURES_CONFIG = {}
|
ui/events/chain_handlers.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from core.settings import VAE_DIR, LORA_DIR, EMBEDDING_DIR, ARCHITECTURES_CONFIG
|
| 3 |
-
from utils.app_utils import
|
| 4 |
from ui.shared.ui_components import (
|
| 5 |
MAX_CONTROLNETS,
|
| 6 |
MAX_IPADAPTERS,
|
|
@@ -20,24 +20,24 @@ def on_vae_upload(file_obj):
|
|
| 20 |
if not file_obj:
|
| 21 |
return gr.update(), gr.update(), None
|
| 22 |
|
| 23 |
-
|
| 24 |
-
return
|
| 25 |
|
| 26 |
|
| 27 |
def on_lora_upload(file_obj):
|
| 28 |
if not file_obj:
|
| 29 |
return gr.update(), gr.update()
|
| 30 |
|
| 31 |
-
|
| 32 |
-
return
|
| 33 |
|
| 34 |
|
| 35 |
def on_embedding_upload(file_obj):
|
| 36 |
if not file_obj:
|
| 37 |
return gr.update(), gr.update(), None
|
| 38 |
|
| 39 |
-
|
| 40 |
-
return
|
| 41 |
|
| 42 |
|
| 43 |
def create_lora_event_handlers(prefix, ui_components):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from core.settings import VAE_DIR, LORA_DIR, EMBEDDING_DIR, ARCHITECTURES_CONFIG
|
| 3 |
+
from utils.app_utils import save_uploaded_file
|
| 4 |
from ui.shared.ui_components import (
|
| 5 |
MAX_CONTROLNETS,
|
| 6 |
MAX_IPADAPTERS,
|
|
|
|
| 20 |
if not file_obj:
|
| 21 |
return gr.update(), gr.update(), None
|
| 22 |
|
| 23 |
+
uploaded_filename = save_uploaded_file(file_obj, VAE_DIR)
|
| 24 |
+
return uploaded_filename, "Upload File", file_obj
|
| 25 |
|
| 26 |
|
| 27 |
def on_lora_upload(file_obj):
|
| 28 |
if not file_obj:
|
| 29 |
return gr.update(), gr.update()
|
| 30 |
|
| 31 |
+
uploaded_filename = save_uploaded_file(file_obj, LORA_DIR)
|
| 32 |
+
return uploaded_filename, "Upload File"
|
| 33 |
|
| 34 |
|
| 35 |
def on_embedding_upload(file_obj):
|
| 36 |
if not file_obj:
|
| 37 |
return gr.update(), gr.update(), None
|
| 38 |
|
| 39 |
+
uploaded_filename = save_uploaded_file(file_obj, EMBEDDING_DIR)
|
| 40 |
+
return uploaded_filename, "Upload File", file_obj
|
| 41 |
|
| 42 |
|
| 43 |
def create_lora_event_handlers(prefix, ui_components):
|
ui/layout.py
CHANGED
|
@@ -12,7 +12,7 @@ def build_ui(event_handler_function):
|
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
gr.Markdown("# ImageGen")
|
| 14 |
gr.Markdown(
|
| 15 |
-
"This demo is a streamlined version of the [Comfy web UI](https://github.com/RioShiina47/comfy-webui)'s [ImageGen](https://huggingface.co/spaces/RioShiina/ImageGen) functionality. Support [High-Level MCP](https://rioshiina-imagegen.hf.space/gradio_api/mcp/)
|
| 16 |
)
|
| 17 |
ui_components.update(create_imagegen_ui())
|
| 18 |
|
|
|
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
gr.Markdown("# ImageGen")
|
| 14 |
gr.Markdown(
|
| 15 |
+
"This demo is a streamlined version of the [Comfy web UI](https://github.com/RioShiina47/comfy-webui)'s [ImageGen](https://huggingface.co/spaces/RioShiina/ImageGen) functionality. Support [High-Level MCP](https://rioshiina-imagegen.hf.space/gradio_api/mcp/)."
|
| 16 |
)
|
| 17 |
ui_components.update(create_imagegen_ui())
|
| 18 |
|
ui/shared/ui_components.py
CHANGED
|
@@ -9,7 +9,7 @@ from core.settings import (
|
|
| 9 |
import yaml
|
| 10 |
import os
|
| 11 |
from functools import lru_cache
|
| 12 |
-
from utils.app_utils import
|
| 13 |
|
| 14 |
default_model_name = list(MODEL_MAP_CHECKPOINT.keys())[0] if MODEL_MAP_CHECKPOINT else None
|
| 15 |
default_m_type = MODEL_TYPE_MAP.get(default_model_name, "SDXL") if default_model_name else "SDXL"
|
|
@@ -519,7 +519,7 @@ def create_embedding_ui(prefix: str):
|
|
| 519 |
|
| 520 |
with gr.Accordion("Embedding Settings", open=False, visible=('embedding' in default_enabled_chains)) as accordion:
|
| 521 |
components[key('embedding_accordion')] = accordion
|
| 522 |
-
gr.Markdown("💡 **Tip:** When downloading from Civitai, please use the **Version ID**, not the Model ID. You can find the Version ID in the URL (e.g., `civitai.com/models/123?modelVersionId=456`) or under the model's download button. For example, entering the Version ID 456 will automatically save the file as \"
|
| 523 |
|
| 524 |
embedding_rows, sources, ids, files, upload_buttons = [], [], [], [], []
|
| 525 |
components.update({
|
|
@@ -595,13 +595,12 @@ def on_vae_upload(file_obj):
|
|
| 595 |
if not file_obj:
|
| 596 |
return gr.update(), gr.update(), None
|
| 597 |
|
| 598 |
-
|
| 599 |
-
return
|
| 600 |
|
| 601 |
def create_vae_override_ui(prefix: str):
|
| 602 |
components = {}
|
| 603 |
key = lambda name: f"{name}_{prefix}"
|
| 604 |
-
source_choices = ["None"] + LORA_SOURCE_CHOICES
|
| 605 |
|
| 606 |
with gr.Accordion("VAE Settings (Override)", open=False, visible=('vae' in default_enabled_chains)) as vae_accordion:
|
| 607 |
components[key('vae_accordion')] = vae_accordion
|
|
@@ -609,8 +608,8 @@ def create_vae_override_ui(prefix: str):
|
|
| 609 |
with gr.Row():
|
| 610 |
components[key('vae_source')] = gr.Dropdown(
|
| 611 |
label="VAE Source",
|
| 612 |
-
choices=
|
| 613 |
-
value="
|
| 614 |
scale=1,
|
| 615 |
interactive=True
|
| 616 |
)
|
|
|
|
| 9 |
import yaml
|
| 10 |
import os
|
| 11 |
from functools import lru_cache
|
| 12 |
+
from utils.app_utils import save_uploaded_file
|
| 13 |
|
| 14 |
default_model_name = list(MODEL_MAP_CHECKPOINT.keys())[0] if MODEL_MAP_CHECKPOINT else None
|
| 15 |
default_m_type = MODEL_TYPE_MAP.get(default_model_name, "SDXL") if default_model_name else "SDXL"
|
|
|
|
| 519 |
|
| 520 |
with gr.Accordion("Embedding Settings", open=False, visible=('embedding' in default_enabled_chains)) as accordion:
|
| 521 |
components[key('embedding_accordion')] = accordion
|
| 522 |
+
gr.Markdown("💡 **Tip:** When downloading from Civitai, please use the **Version ID**, not the Model ID. You can find the Version ID in the URL (e.g., `civitai.com/models/123?modelVersionId=456`) or under the model's download button. For example, entering the Version ID 456 will automatically save the file as \"civitai/456.safetensors\", and you will need to manually enter `embedding:civitai/456` in either your prompt or negative prompt to activate it. When downloading from Hugging Face, please use the format: repo_id/filename.extension or repo_id/folder_path/filename.extension (e.g., ilikebigturtles/lazypos/lazypos.safetensors or ilikebigturtles/lazyneg/lazyneg.safetensors). For Hugging Face files, you will need to enter embedding:huggingface/filename (e.g., entering embedding:huggingface/lazypos in your positive prompt, or embedding:huggingface/lazyneg in your negative prompt) to activate it. For uploaded files, enter `embedding:upload_file/filename` in either your positive prompt or negative prompt to activate it.")
|
| 523 |
|
| 524 |
embedding_rows, sources, ids, files, upload_buttons = [], [], [], [], []
|
| 525 |
components.update({
|
|
|
|
| 595 |
if not file_obj:
|
| 596 |
return gr.update(), gr.update(), None
|
| 597 |
|
| 598 |
+
uploaded_filename = save_uploaded_file(file_obj, VAE_DIR)
|
| 599 |
+
return uploaded_filename, "Upload File", file_obj
|
| 600 |
|
| 601 |
def create_vae_override_ui(prefix: str):
|
| 602 |
components = {}
|
| 603 |
key = lambda name: f"{name}_{prefix}"
|
|
|
|
| 604 |
|
| 605 |
with gr.Accordion("VAE Settings (Override)", open=False, visible=('vae' in default_enabled_chains)) as vae_accordion:
|
| 606 |
components[key('vae_accordion')] = vae_accordion
|
|
|
|
| 608 |
with gr.Row():
|
| 609 |
components[key('vae_source')] = gr.Dropdown(
|
| 610 |
label="VAE Source",
|
| 611 |
+
choices=LORA_SOURCE_CHOICES,
|
| 612 |
+
value="Civitai",
|
| 613 |
scale=1,
|
| 614 |
interactive=True
|
| 615 |
)
|
utils/app_utils.py
CHANGED
|
@@ -43,31 +43,24 @@ class UniqueKeyLoader(yaml.SafeLoader):
|
|
| 43 |
|
| 44 |
UniqueKeyLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, UniqueKeyLoader.construct_mapping)
|
| 45 |
|
| 46 |
-
def
|
| 47 |
if not file_obj:
|
| 48 |
return ""
|
| 49 |
|
| 50 |
temp_path = file_obj.name
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
for block in iter(lambda: f.read(65536), b''):
|
| 55 |
-
sha256.update(block)
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
dest_path = os.path.join(target_dir, hashed_filename)
|
| 62 |
-
|
| 63 |
-
os.makedirs(target_dir, exist_ok=True)
|
| 64 |
-
if not os.path.exists(dest_path):
|
| 65 |
-
shutil.copy(temp_path, dest_path)
|
| 66 |
-
print(f"✅ Saved uploaded file as: {dest_path}")
|
| 67 |
-
else:
|
| 68 |
-
print(f"ℹ️ File already exists (deduplicated): {dest_path}")
|
| 69 |
|
| 70 |
-
return
|
|
|
|
|
|
|
| 71 |
|
| 72 |
def bytes_to_gb(byte_size: int) -> float:
|
| 73 |
if byte_size is None or byte_size == 0:
|
|
@@ -196,8 +189,13 @@ def get_lora_path(source: str, id_or_url: str, civitai_key: str, progress) -> tu
|
|
| 196 |
if model_type and model_type.lower() == 'checkpoint':
|
| 197 |
return None, f"Invalid Civitai model type '{model_type}' for LoRA. Checkpoint models are not allowed."
|
| 198 |
|
| 199 |
-
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
api_key_to_use = civitai_key
|
| 202 |
source_name = f"Civitai ID {version_id}"
|
| 203 |
elif source == "Hugging Face":
|
|
@@ -206,9 +204,9 @@ def get_lora_path(source: str, id_or_url: str, civitai_key: str, progress) -> tu
|
|
| 206 |
return None, "Invalid Hugging Face path. Format: repo_owner/repo_name/filename"
|
| 207 |
repo_id = f"{parts[0]}/{parts[1]}"
|
| 208 |
repo_file_path = "/".join(parts[2:])
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
local_path = os.path.join(
|
| 212 |
source_name = f"HF {repo_file_path}"
|
| 213 |
else:
|
| 214 |
return None, "Invalid source."
|
|
@@ -226,13 +224,14 @@ def get_lora_path(source: str, id_or_url: str, civitai_key: str, progress) -> tu
|
|
| 226 |
if not file_info or not file_info.get('downloadUrl'):
|
| 227 |
return None, f"Could not get download link for {source_name}."
|
| 228 |
|
|
|
|
| 229 |
status = download_file(file_info['downloadUrl'], local_path, api_key_to_use, progress=progress, desc=f"Downloading {source_name}")
|
| 230 |
return (local_path, status) if "Successfully" in status else (None, status)
|
| 231 |
elif source == "Hugging Face":
|
| 232 |
try:
|
| 233 |
if progress: progress(0, desc=f"Downloading {source_name}")
|
| 234 |
cached_path = hf_hub_download(repo_id=repo_id, filename=repo_file_path, token=os.environ.get("HF_TOKEN"))
|
| 235 |
-
os.makedirs(
|
| 236 |
os.symlink(cached_path, local_path)
|
| 237 |
if progress: progress(1.0, desc=f"Downloaded {source_name}")
|
| 238 |
return local_path, f"Successfully downloaded: {filename}"
|
|
@@ -259,8 +258,9 @@ def get_embedding_path(source: str, id_or_url: str, civitai_key: str, progress)
|
|
| 259 |
if file_info and file_info.get('name') and file_info['name'].lower().endswith(('.pt', '.bin')):
|
| 260 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 261 |
|
| 262 |
-
filename = sanitize_filename(f"
|
| 263 |
-
|
|
|
|
| 264 |
api_key_to_use = civitai_key
|
| 265 |
source_name = f"Embedding Civitai ID {version_id}"
|
| 266 |
elif source == "Hugging Face":
|
|
@@ -270,7 +270,8 @@ def get_embedding_path(source: str, id_or_url: str, civitai_key: str, progress)
|
|
| 270 |
repo_id = f"{parts[0]}/{parts[1]}"
|
| 271 |
repo_file_path = "/".join(parts[2:])
|
| 272 |
filename = sanitize_filename(parts[-1])
|
| 273 |
-
|
|
|
|
| 274 |
source_name = f"Embedding HF {repo_file_path}"
|
| 275 |
else:
|
| 276 |
return None, "Invalid source."
|
|
@@ -288,13 +289,14 @@ def get_embedding_path(source: str, id_or_url: str, civitai_key: str, progress)
|
|
| 288 |
if not file_info or not file_info.get('downloadUrl'):
|
| 289 |
return None, f"Could not get download link for {source_name}."
|
| 290 |
|
|
|
|
| 291 |
status = download_file(file_info['downloadUrl'], local_path, api_key_to_use, progress=progress, desc=f"Downloading {source_name}")
|
| 292 |
return (local_path, status) if "Successfully" in status else (None, status)
|
| 293 |
elif source == "Hugging Face":
|
| 294 |
try:
|
| 295 |
if progress: progress(0, desc=f"Downloading {source_name}")
|
| 296 |
cached_path = hf_hub_download(repo_id=repo_id, filename=repo_file_path, token=os.environ.get("HF_TOKEN"))
|
| 297 |
-
os.makedirs(
|
| 298 |
os.symlink(cached_path, local_path)
|
| 299 |
if progress: progress(1.0, desc=f"Downloaded {source_name}")
|
| 300 |
return local_path, f"Successfully downloaded: {filename}"
|
|
@@ -321,8 +323,9 @@ def get_vae_path(source: str, id_or_url: str, civitai_key: str, progress) -> tup
|
|
| 321 |
if file_info and file_info.get('name') and file_info['name'].lower().endswith(('.pt', '.bin')):
|
| 322 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 323 |
|
| 324 |
-
filename = sanitize_filename(f"
|
| 325 |
-
|
|
|
|
| 326 |
api_key_to_use = civitai_key
|
| 327 |
source_name = f"VAE Civitai ID {version_id}"
|
| 328 |
elif source == "Hugging Face":
|
|
@@ -331,9 +334,9 @@ def get_vae_path(source: str, id_or_url: str, civitai_key: str, progress) -> tup
|
|
| 331 |
return None, "Invalid Hugging Face path. Format: repo_owner/repo_name/filename"
|
| 332 |
repo_id = f"{parts[0]}/{parts[1]}"
|
| 333 |
repo_file_path = "/".join(parts[2:])
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
local_path = os.path.join(
|
| 337 |
source_name = f"VAE HF {repo_file_path}"
|
| 338 |
else:
|
| 339 |
return None, "Invalid source."
|
|
@@ -351,13 +354,14 @@ def get_vae_path(source: str, id_or_url: str, civitai_key: str, progress) -> tup
|
|
| 351 |
if not file_info or not file_info.get('downloadUrl'):
|
| 352 |
return None, f"Could not get download link for {source_name}."
|
| 353 |
|
|
|
|
| 354 |
status = download_file(file_info['downloadUrl'], local_path, api_key_to_use, progress=progress, desc=f"Downloading {source_name}")
|
| 355 |
return (local_path, status) if "Successfully" in status else (None, status)
|
| 356 |
elif source == "Hugging Face":
|
| 357 |
try:
|
| 358 |
if progress: progress(0, desc=f"Downloading {source_name}")
|
| 359 |
cached_path = hf_hub_download(repo_id=repo_id, filename=repo_file_path, token=os.environ.get("HF_TOKEN"))
|
| 360 |
-
os.makedirs(
|
| 361 |
os.symlink(cached_path, local_path)
|
| 362 |
if progress: progress(1.0, desc=f"Downloaded {source_name}")
|
| 363 |
return local_path, f"Successfully downloaded: {filename}"
|
|
|
|
| 43 |
|
| 44 |
UniqueKeyLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, UniqueKeyLoader.construct_mapping)
|
| 45 |
|
| 46 |
+
def save_uploaded_file(file_obj: gr.File, target_dir: str) -> str:
|
| 47 |
if not file_obj:
|
| 48 |
return ""
|
| 49 |
|
| 50 |
temp_path = file_obj.name
|
| 51 |
+
orig_filename = getattr(file_obj, 'orig_name', None) or os.path.basename(temp_path)
|
| 52 |
+
clean_filename = sanitize_filename(orig_filename)
|
| 53 |
|
| 54 |
+
upload_dir = os.path.join(target_dir, "upload_file")
|
| 55 |
+
dest_path = os.path.join(upload_dir, clean_filename)
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
os.makedirs(upload_dir, exist_ok=True)
|
| 58 |
+
shutil.copy(temp_path, dest_path)
|
| 59 |
+
print(f"✅ Saved uploaded file as: {dest_path}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
return clean_filename
|
| 62 |
+
|
| 63 |
+
save_uploaded_file_with_hash = save_uploaded_file
|
| 64 |
|
| 65 |
def bytes_to_gb(byte_size: int) -> float:
|
| 66 |
if byte_size is None or byte_size == 0:
|
|
|
|
| 189 |
if model_type and model_type.lower() == 'checkpoint':
|
| 190 |
return None, f"Invalid Civitai model type '{model_type}' for LoRA. Checkpoint models are not allowed."
|
| 191 |
|
| 192 |
+
file_ext = ".safetensors"
|
| 193 |
+
if file_info and file_info.get('name') and file_info['name'].lower().endswith(('.pt', '.bin')):
|
| 194 |
+
file_ext = os.path.splitext(file_info['name'])[1]
|
| 195 |
+
|
| 196 |
+
filename = sanitize_filename(f"{version_id}{file_ext}")
|
| 197 |
+
save_dir = os.path.join(LORA_DIR, "civitai")
|
| 198 |
+
local_path = os.path.join(save_dir, filename)
|
| 199 |
api_key_to_use = civitai_key
|
| 200 |
source_name = f"Civitai ID {version_id}"
|
| 201 |
elif source == "Hugging Face":
|
|
|
|
| 204 |
return None, "Invalid Hugging Face path. Format: repo_owner/repo_name/filename"
|
| 205 |
repo_id = f"{parts[0]}/{parts[1]}"
|
| 206 |
repo_file_path = "/".join(parts[2:])
|
| 207 |
+
filename = sanitize_filename(parts[-1])
|
| 208 |
+
save_dir = os.path.join(LORA_DIR, "huggingface")
|
| 209 |
+
local_path = os.path.join(save_dir, filename)
|
| 210 |
source_name = f"HF {repo_file_path}"
|
| 211 |
else:
|
| 212 |
return None, "Invalid source."
|
|
|
|
| 224 |
if not file_info or not file_info.get('downloadUrl'):
|
| 225 |
return None, f"Could not get download link for {source_name}."
|
| 226 |
|
| 227 |
+
os.makedirs(os.path.dirname(local_path), exist_ok=True)
|
| 228 |
status = download_file(file_info['downloadUrl'], local_path, api_key_to_use, progress=progress, desc=f"Downloading {source_name}")
|
| 229 |
return (local_path, status) if "Successfully" in status else (None, status)
|
| 230 |
elif source == "Hugging Face":
|
| 231 |
try:
|
| 232 |
if progress: progress(0, desc=f"Downloading {source_name}")
|
| 233 |
cached_path = hf_hub_download(repo_id=repo_id, filename=repo_file_path, token=os.environ.get("HF_TOKEN"))
|
| 234 |
+
os.makedirs(os.path.dirname(local_path), exist_ok=True)
|
| 235 |
os.symlink(cached_path, local_path)
|
| 236 |
if progress: progress(1.0, desc=f"Downloaded {source_name}")
|
| 237 |
return local_path, f"Successfully downloaded: {filename}"
|
|
|
|
| 258 |
if file_info and file_info.get('name') and file_info['name'].lower().endswith(('.pt', '.bin')):
|
| 259 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 260 |
|
| 261 |
+
filename = sanitize_filename(f"{version_id}{file_ext}")
|
| 262 |
+
save_dir = os.path.join(EMBEDDING_DIR, "civitai")
|
| 263 |
+
local_path = os.path.join(save_dir, filename)
|
| 264 |
api_key_to_use = civitai_key
|
| 265 |
source_name = f"Embedding Civitai ID {version_id}"
|
| 266 |
elif source == "Hugging Face":
|
|
|
|
| 270 |
repo_id = f"{parts[0]}/{parts[1]}"
|
| 271 |
repo_file_path = "/".join(parts[2:])
|
| 272 |
filename = sanitize_filename(parts[-1])
|
| 273 |
+
save_dir = os.path.join(EMBEDDING_DIR, "huggingface")
|
| 274 |
+
local_path = os.path.join(save_dir, filename)
|
| 275 |
source_name = f"Embedding HF {repo_file_path}"
|
| 276 |
else:
|
| 277 |
return None, "Invalid source."
|
|
|
|
| 289 |
if not file_info or not file_info.get('downloadUrl'):
|
| 290 |
return None, f"Could not get download link for {source_name}."
|
| 291 |
|
| 292 |
+
os.makedirs(os.path.dirname(local_path), exist_ok=True)
|
| 293 |
status = download_file(file_info['downloadUrl'], local_path, api_key_to_use, progress=progress, desc=f"Downloading {source_name}")
|
| 294 |
return (local_path, status) if "Successfully" in status else (None, status)
|
| 295 |
elif source == "Hugging Face":
|
| 296 |
try:
|
| 297 |
if progress: progress(0, desc=f"Downloading {source_name}")
|
| 298 |
cached_path = hf_hub_download(repo_id=repo_id, filename=repo_file_path, token=os.environ.get("HF_TOKEN"))
|
| 299 |
+
os.makedirs(os.path.dirname(local_path), exist_ok=True)
|
| 300 |
os.symlink(cached_path, local_path)
|
| 301 |
if progress: progress(1.0, desc=f"Downloaded {source_name}")
|
| 302 |
return local_path, f"Successfully downloaded: {filename}"
|
|
|
|
| 323 |
if file_info and file_info.get('name') and file_info['name'].lower().endswith(('.pt', '.bin')):
|
| 324 |
file_ext = os.path.splitext(file_info['name'])[1]
|
| 325 |
|
| 326 |
+
filename = sanitize_filename(f"{version_id}{file_ext}")
|
| 327 |
+
save_dir = os.path.join(VAE_DIR, "civitai")
|
| 328 |
+
local_path = os.path.join(save_dir, filename)
|
| 329 |
api_key_to_use = civitai_key
|
| 330 |
source_name = f"VAE Civitai ID {version_id}"
|
| 331 |
elif source == "Hugging Face":
|
|
|
|
| 334 |
return None, "Invalid Hugging Face path. Format: repo_owner/repo_name/filename"
|
| 335 |
repo_id = f"{parts[0]}/{parts[1]}"
|
| 336 |
repo_file_path = "/".join(parts[2:])
|
| 337 |
+
filename = sanitize_filename(parts[-1])
|
| 338 |
+
save_dir = os.path.join(VAE_DIR, "huggingface")
|
| 339 |
+
local_path = os.path.join(save_dir, filename)
|
| 340 |
source_name = f"VAE HF {repo_file_path}"
|
| 341 |
else:
|
| 342 |
return None, "Invalid source."
|
|
|
|
| 354 |
if not file_info or not file_info.get('downloadUrl'):
|
| 355 |
return None, f"Could not get download link for {source_name}."
|
| 356 |
|
| 357 |
+
os.makedirs(os.path.dirname(local_path), exist_ok=True)
|
| 358 |
status = download_file(file_info['downloadUrl'], local_path, api_key_to_use, progress=progress, desc=f"Downloading {source_name}")
|
| 359 |
return (local_path, status) if "Successfully" in status else (None, status)
|
| 360 |
elif source == "Hugging Face":
|
| 361 |
try:
|
| 362 |
if progress: progress(0, desc=f"Downloading {source_name}")
|
| 363 |
cached_path = hf_hub_download(repo_id=repo_id, filename=repo_file_path, token=os.environ.get("HF_TOKEN"))
|
| 364 |
+
os.makedirs(os.path.dirname(local_path), exist_ok=True)
|
| 365 |
os.symlink(cached_path, local_path)
|
| 366 |
if progress: progress(1.0, desc=f"Downloaded {source_name}")
|
| 367 |
return local_path, f"Successfully downloaded: {filename}"
|
yaml/chain_features.yaml
CHANGED
|
@@ -6,17 +6,17 @@ lora:
|
|
| 6 |
display_name: "LoRA Fine-tuning Injector"
|
| 7 |
description: "Injects LoRA weights into UNet/DiT model and CLIP text encoder for custom style, character, or domain adaptation. Note: For Civitai, specify the Version ID (modelVersionId) instead of the main Model ID."
|
| 8 |
max_count: 5
|
| 9 |
-
usage_guideline: "Specify source ('Civitai'
|
| 10 |
parameters_schema:
|
| 11 |
type: object
|
| 12 |
properties:
|
| 13 |
source:
|
| 14 |
type: string
|
| 15 |
-
enum: ["Civitai", "Hugging Face"]
|
| 16 |
-
description: "Download source for the LoRA model. Use 'Civitai' to download by Version ID (modelVersionId),
|
| 17 |
lora_value:
|
| 18 |
type: string
|
| 19 |
-
description: "For Civitai: the Version ID (modelVersionId). For Hugging Face: repo_id/filename.extension or repo_id/folder_path/filename.extension."
|
| 20 |
scale:
|
| 21 |
type: number
|
| 22 |
default: 1.0
|
|
@@ -154,17 +154,17 @@ vae:
|
|
| 154 |
display_name: "Custom VAE Loader"
|
| 155 |
description: "Overrides default VAE model used for latent space encoding and final image decoding."
|
| 156 |
max_count: 1
|
| 157 |
-
usage_guideline: "Specify source ('Civitai'
|
| 158 |
parameters_schema:
|
| 159 |
type: object
|
| 160 |
properties:
|
| 161 |
source:
|
| 162 |
type: string
|
| 163 |
-
enum: ["Civitai", "Hugging Face"]
|
| 164 |
-
description: "Download source for the VAE model. Use 'Civitai' to download by Version ID,
|
| 165 |
vae_value:
|
| 166 |
type: string
|
| 167 |
-
description: "For Civitai: the Version ID (e.g., '456' from civitai.com/models/123?modelVersionId=456). For Hugging Face: repo_id/filename.extension or repo_id/folder_path/filename.extension (e.g., 'madebyollin/sdxl-vae-fp16-fix/sdxl_vae.safetensors')."
|
| 168 |
required:
|
| 169 |
- source
|
| 170 |
- vae_value
|
|
@@ -504,9 +504,9 @@ sd3_ipadapter:
|
|
| 504 |
embedding:
|
| 505 |
chains: embedding
|
| 506 |
display_name: "Textual Inversion Embedding Injector"
|
| 507 |
-
description: "Downloads Textual Inversion embedding files from Civitai
|
| 508 |
max_count: 5
|
| 509 |
-
usage_guideline: "Specify source ('Civitai'
|
| 510 |
parameters_schema:
|
| 511 |
type: object
|
| 512 |
properties:
|
|
@@ -515,10 +515,11 @@ embedding:
|
|
| 515 |
enum:
|
| 516 |
- "Civitai"
|
| 517 |
- "Hugging Face"
|
| 518 |
-
|
|
|
|
| 519 |
embedding_value:
|
| 520 |
type: string
|
| 521 |
-
description: "For Civitai: the Version ID (e.g., '456' from civitai.com/models/123?modelVersionId=456, saved as '
|
| 522 |
required:
|
| 523 |
- source
|
| 524 |
- embedding_value
|
|
|
|
| 6 |
display_name: "LoRA Fine-tuning Injector"
|
| 7 |
description: "Injects LoRA weights into UNet/DiT model and CLIP text encoder for custom style, character, or domain adaptation. Note: For Civitai, specify the Version ID (modelVersionId) instead of the main Model ID."
|
| 8 |
max_count: 5
|
| 9 |
+
usage_guideline: "Specify source ('Civitai', 'Hugging Face', or 'Upload File'). For Civitai, provide lora_value as the Version ID (modelVersionId). For Hugging Face, provide HF repo file path. For Upload File, provide uploaded filename. Scale (0.0~2.0) controls weight strength."
|
| 10 |
parameters_schema:
|
| 11 |
type: object
|
| 12 |
properties:
|
| 13 |
source:
|
| 14 |
type: string
|
| 15 |
+
enum: ["Civitai", "Hugging Face", "Upload File"]
|
| 16 |
+
description: "Download/upload source for the LoRA model. Use 'Civitai' to download by Version ID (modelVersionId), 'Hugging Face' to download by repo file path, or 'Upload File' for uploaded files."
|
| 17 |
lora_value:
|
| 18 |
type: string
|
| 19 |
+
description: "For Civitai: the Version ID (modelVersionId). For Hugging Face: repo_id/filename.extension or repo_id/folder_path/filename.extension. For Upload File: uploaded filename."
|
| 20 |
scale:
|
| 21 |
type: number
|
| 22 |
default: 1.0
|
|
|
|
| 154 |
display_name: "Custom VAE Loader"
|
| 155 |
description: "Overrides default VAE model used for latent space encoding and final image decoding."
|
| 156 |
max_count: 1
|
| 157 |
+
usage_guideline: "Specify source ('Civitai', 'Hugging Face', or 'Upload File'), then provide the vae_value (Civitai Version ID, HF file path, or uploaded filename)."
|
| 158 |
parameters_schema:
|
| 159 |
type: object
|
| 160 |
properties:
|
| 161 |
source:
|
| 162 |
type: string
|
| 163 |
+
enum: ["Civitai", "Hugging Face", "Upload File"]
|
| 164 |
+
description: "Download/upload source for the VAE model. Use 'Civitai' to download by Version ID, 'Hugging Face' to download by repo path, or 'Upload File' for uploaded file."
|
| 165 |
vae_value:
|
| 166 |
type: string
|
| 167 |
+
description: "For Civitai: the Version ID (e.g., '456' from civitai.com/models/123?modelVersionId=456). For Hugging Face: repo_id/filename.extension or repo_id/folder_path/filename.extension (e.g., 'madebyollin/sdxl-vae-fp16-fix/sdxl_vae.safetensors'). For Upload File: uploaded file name."
|
| 168 |
required:
|
| 169 |
- source
|
| 170 |
- vae_value
|
|
|
|
| 504 |
embedding:
|
| 505 |
chains: embedding
|
| 506 |
display_name: "Textual Inversion Embedding Injector"
|
| 507 |
+
description: "Downloads Textual Inversion embedding files from Civitai, Hugging Face, or uploads to the server. Note: This feature ONLY handles file downloading/preparation. To activate the embedding, manually add 'embedding:<filename>' (e.g. 'embedding:civitai/456' for Civitai ID 456, 'embedding:huggingface/lazypos' for Hugging Face, or 'embedding:upload_file/filename' for uploaded files) into your prompt or negative_prompt."
|
| 508 |
max_count: 5
|
| 509 |
+
usage_guideline: "Specify source ('Civitai', 'Hugging Face', or 'Upload File'), and embedding_value (Civitai Version ID, HF repo file path, or uploaded filename). The file is stored on server; manually enter 'embedding:<filename>' in prompt or negative_prompt to activate."
|
| 510 |
parameters_schema:
|
| 511 |
type: object
|
| 512 |
properties:
|
|
|
|
| 515 |
enum:
|
| 516 |
- "Civitai"
|
| 517 |
- "Hugging Face"
|
| 518 |
+
- "Upload File"
|
| 519 |
+
description: "Download source for the Textual Inversion embedding file. Use 'Civitai' to download by Version ID, 'Hugging Face' to download by repo file path, or 'Upload File' for uploaded files."
|
| 520 |
embedding_value:
|
| 521 |
type: string
|
| 522 |
+
description: "For Civitai: the Version ID (e.g., '456' from civitai.com/models/123?modelVersionId=456, saved as 'civitai/456.safetensors'). For Hugging Face: repo_id/filename.extension (e.g., 'ilikebigturtles/lazypos/lazypos.safetensors', saved as 'huggingface/lazypos.safetensors'). For Upload File: uploaded filename (saved as 'upload_file/filename.safetensors'). Manually reference embedding:<filename> in prompt or negative_prompt."
|
| 523 |
required:
|
| 524 |
- source
|
| 525 |
- embedding_value
|
yaml/constants.yaml
CHANGED
|
@@ -4,7 +4,7 @@ MAX_IPADAPTERS: 5
|
|
| 4 |
MAX_EMBEDDINGS: 5
|
| 5 |
MAX_CONDITIONINGS: 10
|
| 6 |
MAX_REFERENCE_LATENTS: 10
|
| 7 |
-
LORA_SOURCE_CHOICES: ["Civitai", "Hugging Face", "File"]
|
| 8 |
|
| 9 |
RESOLUTION_MAP:
|
| 10 |
krea-2:
|
|
|
|
| 4 |
MAX_EMBEDDINGS: 5
|
| 5 |
MAX_CONDITIONINGS: 10
|
| 6 |
MAX_REFERENCE_LATENTS: 10
|
| 7 |
+
LORA_SOURCE_CHOICES: ["Civitai", "Hugging Face", "Upload File"]
|
| 8 |
|
| 9 |
RESOLUTION_MAP:
|
| 10 |
krea-2:
|
yaml/file_list.yaml
CHANGED
|
@@ -797,6 +797,10 @@ file:
|
|
| 797 |
repo_id: "ostris/krea2_turbo_style_reference"
|
| 798 |
repository_file_path: "krea2_style_reference.safetensors"
|
| 799 |
# Krea2 ControlNet
|
|
|
|
|
|
|
|
|
|
|
|
|
| 800 |
- filename: "depth-control-lora.safetensors"
|
| 801 |
source: "hf"
|
| 802 |
repo_id: "Patil/Krea-2-depth-controlnet"
|
|
|
|
| 797 |
repo_id: "ostris/krea2_turbo_style_reference"
|
| 798 |
repository_file_path: "krea2_style_reference.safetensors"
|
| 799 |
# Krea2 ControlNet
|
| 800 |
+
- filename: "krea2-anythng_step_007000.safetensors"
|
| 801 |
+
source: "hf"
|
| 802 |
+
repo_id: "tori29umai/krea2-controlnet"
|
| 803 |
+
repository_file_path: "krea2-anythng_step_007000.safetensors"
|
| 804 |
- filename: "depth-control-lora.safetensors"
|
| 805 |
source: "hf"
|
| 806 |
repo_id: "Patil/Krea-2-depth-controlnet"
|
yaml/krea2_controlnet_models.yaml
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
Krea2_ControlNet:
|
|
|
|
|
|
|
|
|
|
| 2 |
- Filepath: "depth-control-lora.safetensors"
|
| 3 |
Series: "Patil"
|
| 4 |
Type: ["Depth"]
|
|
|
|
| 1 |
Krea2_ControlNet:
|
| 2 |
+
- Filepath: "krea2-anythng_step_007000.safetensors"
|
| 3 |
+
Series: "tori29umai"
|
| 4 |
+
Type: ["Anythng"]
|
| 5 |
- Filepath: "depth-control-lora.safetensors"
|
| 6 |
Series: "Patil"
|
| 7 |
Type: ["Depth"]
|
yaml/model_defaults.yaml
CHANGED
|
@@ -158,13 +158,41 @@ Anima:
|
|
| 158 |
cfg: 4.0
|
| 159 |
sampler_name: "er_sde"
|
| 160 |
scheduler: "simple"
|
| 161 |
-
positive_prompt: "masterpiece, best quality, score_7, safe
|
| 162 |
negative_prompt: "worst quality, low quality, score_1, score_2, score_3, blurry, jpeg artifacts, sepia"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
"Gazingstars123/Anima-2.9B-preview-v1":
|
| 164 |
steps: 30
|
| 165 |
cfg: 4.0
|
| 166 |
-
|
| 167 |
scheduler: "sgm_uniform"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
NewBie-Image:
|
| 170 |
_defaults:
|
|
@@ -304,9 +332,173 @@ SDXL:
|
|
| 304 |
cfg: 1.0
|
| 305 |
positive_prompt: "NOTE: The model generates images of size 512x512 but higher image sizes work as well."
|
| 306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
SD1.5:
|
| 308 |
_defaults:
|
| 309 |
-
steps:
|
| 310 |
cfg: 7.0
|
| 311 |
sampler_name: "euler_ancestral"
|
| 312 |
-
scheduler: "simple"
|
|
|
|
|
|
|
|
|
| 158 |
cfg: 4.0
|
| 159 |
sampler_name: "er_sde"
|
| 160 |
scheduler: "simple"
|
| 161 |
+
positive_prompt: "masterpiece, best quality, score_7, safe, "
|
| 162 |
negative_prompt: "worst quality, low quality, score_1, score_2, score_3, blurry, jpeg artifacts, sepia"
|
| 163 |
+
"circlestone-labs/Anima-Turbo-v1.0":
|
| 164 |
+
steps: 10
|
| 165 |
+
cfg: 1.0
|
| 166 |
+
sampler_name: "er_sde"
|
| 167 |
+
scheduler: "simple"
|
| 168 |
+
"WAI0731/waiANIMA-v1.0":
|
| 169 |
+
steps: 28
|
| 170 |
+
cfg: 4.0
|
| 171 |
+
sampler_name: "euler_ancestral"
|
| 172 |
+
scheduler: "simple"
|
| 173 |
+
positive_prompt: "masterpiece, best quality, score_9, score_8, score_7, safe, "
|
| 174 |
+
negative_prompt: "worst quality, low quality, score_1, score_2, score_3, artist name, blurry, jpeg artifacts, lowres, censor"
|
| 175 |
"Gazingstars123/Anima-2.9B-preview-v1":
|
| 176 |
steps: 30
|
| 177 |
cfg: 4.0
|
| 178 |
+
sampler_name: "er_sde"
|
| 179 |
scheduler: "sgm_uniform"
|
| 180 |
+
positive_prompt: "masterpiece, best quality, highres, absurdres, newest, score_7, safe, "
|
| 181 |
+
negative_prompt: "lowres, bad quality, worst quality, score_1, score_2, score_3, jpeg artifacts, signature, watermark"
|
| 182 |
+
"motimalu/Kirazuri (Anima)-v4.0":
|
| 183 |
+
steps: 30
|
| 184 |
+
cfg: 4.0
|
| 185 |
+
sampler_name: "er_sde"
|
| 186 |
+
scheduler: "simple"
|
| 187 |
+
positive_prompt: "masterpiece, best quality, very aesthetic, score_7, safe, "
|
| 188 |
+
negative_prompt: "worst quality, low quality, score_1, score_2, score_3, blurry, jpeg artifacts, sepia"
|
| 189 |
+
"Ikena/Hassaku-Anima-v1.3":
|
| 190 |
+
steps: 25
|
| 191 |
+
cfg: 3.5
|
| 192 |
+
sampler_name: "er_sde"
|
| 193 |
+
scheduler: "simple"
|
| 194 |
+
positive_prompt: "masterpiece, best quality, score_7, safe, "
|
| 195 |
+
negative_prompt: "worst quality, low quality, score_1, score_2, score_3, blurry, jpeg artifacts"
|
| 196 |
|
| 197 |
NewBie-Image:
|
| 198 |
_defaults:
|
|
|
|
| 332 |
cfg: 1.0
|
| 333 |
positive_prompt: "NOTE: The model generates images of size 512x512 but higher image sizes work as well."
|
| 334 |
|
| 335 |
+
# --- NoobAI ---
|
| 336 |
+
"Laxhar/noobai-XL-Vpred-1.0":
|
| 337 |
+
steps: 28
|
| 338 |
+
cfg: 5.0
|
| 339 |
+
sampler_name: "euler"
|
| 340 |
+
scheduler: "simple"
|
| 341 |
+
positive_prompt: "masterpiece, best quality, newest, absurdres, highres, safe, "
|
| 342 |
+
negative_prompt: "nsfw, worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 343 |
+
"Laxhar/noobai-XL-1.1":
|
| 344 |
+
steps: 28
|
| 345 |
+
cfg: 5.0
|
| 346 |
+
sampler_name: "euler"
|
| 347 |
+
scheduler: "simple"
|
| 348 |
+
positive_prompt: "masterpiece, best quality, newest, absurdres, highres, safe, "
|
| 349 |
+
negative_prompt: "nsfw, worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 350 |
+
"bluepen5805/noob_v_pencil-XL-3.0.0":
|
| 351 |
+
steps: 28
|
| 352 |
+
cfg: 5.0
|
| 353 |
+
sampler_name: "euler"
|
| 354 |
+
scheduler: "simple"
|
| 355 |
+
positive_prompt: "masterpiece, best quality, newest, absurdres, highres, safe, "
|
| 356 |
+
negative_prompt: "nsfw, worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 357 |
+
"RedRayz/hikari_noob_v-pred_1.2.4":
|
| 358 |
+
steps: 28
|
| 359 |
+
cfg: 5.0
|
| 360 |
+
sampler_name: "euler"
|
| 361 |
+
scheduler: "simple"
|
| 362 |
+
positive_prompt: "masterpiece, best quality, newest, absurdres, highres, safe, "
|
| 363 |
+
negative_prompt: "nsfw, worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 364 |
+
"ChenkinNoob/ChenkinNoob-XL-V0.5":
|
| 365 |
+
steps: 28
|
| 366 |
+
cfg: 5.0
|
| 367 |
+
sampler_name: "euler"
|
| 368 |
+
scheduler: "simple"
|
| 369 |
+
positive_prompt: "masterpiece, best quality, newest, absurdres, highres, safe, "
|
| 370 |
+
negative_prompt: "nsfw, worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 371 |
+
|
| 372 |
+
# --- Illustrious ---
|
| 373 |
+
"WAI0731/wai-illustrious-sdxl-v170":
|
| 374 |
+
steps: 28
|
| 375 |
+
cfg: 5.5
|
| 376 |
+
sampler_name: "euler"
|
| 377 |
+
scheduler: "simple"
|
| 378 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 379 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 380 |
+
"OnomaAIResearch/Illustrious-XL-v2.0":
|
| 381 |
+
steps: 28
|
| 382 |
+
cfg: 5.5
|
| 383 |
+
sampler_name: "euler"
|
| 384 |
+
scheduler: "simple"
|
| 385 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 386 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 387 |
+
"OnomaAIResearch/Illustrious-XL-v1.1":
|
| 388 |
+
steps: 28
|
| 389 |
+
cfg: 5.5
|
| 390 |
+
sampler_name: "euler"
|
| 391 |
+
scheduler: "simple"
|
| 392 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 393 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 394 |
+
"OnomaAIResearch/Illustrious-XL-v1.0":
|
| 395 |
+
steps: 28
|
| 396 |
+
cfg: 5.5
|
| 397 |
+
sampler_name: "euler"
|
| 398 |
+
scheduler: "simple"
|
| 399 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 400 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 401 |
+
"aria1th261/Illustrious-XL-v0.1":
|
| 402 |
+
steps: 28
|
| 403 |
+
cfg: 5.5
|
| 404 |
+
sampler_name: "euler"
|
| 405 |
+
scheduler: "simple"
|
| 406 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 407 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 408 |
+
"Crody/Nova-Anime-XL-v18.0":
|
| 409 |
+
steps: 28
|
| 410 |
+
cfg: 5.5
|
| 411 |
+
sampler_name: "euler"
|
| 412 |
+
scheduler: "simple"
|
| 413 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 414 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 415 |
+
"Ikena/hassaku-xl-illustrious-v3.0":
|
| 416 |
+
steps: 28
|
| 417 |
+
cfg: 5.5
|
| 418 |
+
sampler_name: "euler"
|
| 419 |
+
scheduler: "simple"
|
| 420 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 421 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 422 |
+
"blue_pen5805/illustrious_pencil-XL-v5.0.0":
|
| 423 |
+
steps: 25
|
| 424 |
+
cfg: 5.0
|
| 425 |
+
sampler_name: "euler_ancestral"
|
| 426 |
+
scheduler: "simple"
|
| 427 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 428 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands, mammal, anthro, furry, ambiguous form, feral, semi-anthro"
|
| 429 |
+
"blue_pen5805/mellow_pencil-XL-v1.0.0":
|
| 430 |
+
steps: 18
|
| 431 |
+
cfg: 3.0
|
| 432 |
+
sampler_name: "euler_ancestral"
|
| 433 |
+
scheduler: "simple"
|
| 434 |
+
positive_prompt: "masterpiece, best quality, aesthetic, absurdres, newest, "
|
| 435 |
+
negative_prompt: "worst quality, old, early, low quality, lowres, signature, username, logo, bad hands, mutated hands"
|
| 436 |
+
|
| 437 |
+
# --- Animagine / Anime ---
|
| 438 |
+
"CagliostroLab/Animagine XL 4.0":
|
| 439 |
+
steps: 28
|
| 440 |
+
cfg: 6.0
|
| 441 |
+
sampler_name: "euler_ancestral"
|
| 442 |
+
scheduler: "simple"
|
| 443 |
+
positive_prompt: "masterpiece, best quality, very aesthetic, absurdres, "
|
| 444 |
+
negative_prompt: "lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]"
|
| 445 |
+
"CagliostroLab/Animagine XL 3.1":
|
| 446 |
+
steps: 28
|
| 447 |
+
cfg: 6.0
|
| 448 |
+
sampler_name: "euler_ancestral"
|
| 449 |
+
scheduler: "simple"
|
| 450 |
+
positive_prompt: "masterpiece, best quality, very aesthetic, absurdres, "
|
| 451 |
+
negative_prompt: "lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]"
|
| 452 |
+
"blue_pen5805/4nima_pencil-XL v1.0.1":
|
| 453 |
+
steps: 28
|
| 454 |
+
cfg: 6.0
|
| 455 |
+
sampler_name: "euler_ancestral"
|
| 456 |
+
scheduler: "simple"
|
| 457 |
+
positive_prompt: "masterpiece, best quality, very aesthetic, absurdres, "
|
| 458 |
+
negative_prompt: "lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]"
|
| 459 |
+
"blue_pen5805/anima_pencil-XL v5.0.0":
|
| 460 |
+
steps: 28
|
| 461 |
+
cfg: 6.0
|
| 462 |
+
sampler_name: "euler_ancestral"
|
| 463 |
+
scheduler: "simple"
|
| 464 |
+
positive_prompt: "masterpiece, best quality, very aesthetic, absurdres, "
|
| 465 |
+
negative_prompt: "lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]"
|
| 466 |
+
"blue_pen5805/blue_pencil-XL v7.0.0":
|
| 467 |
+
steps: 28
|
| 468 |
+
cfg: 6.0
|
| 469 |
+
sampler_name: "euler_ancestral"
|
| 470 |
+
scheduler: "simple"
|
| 471 |
+
positive_prompt: "masterpiece, best quality, very aesthetic, absurdres, "
|
| 472 |
+
negative_prompt: "lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]"
|
| 473 |
+
|
| 474 |
+
# --- Pony ---
|
| 475 |
+
"PurpleSmartAI/Pony Diffusion V6 XL":
|
| 476 |
+
steps: 28
|
| 477 |
+
cfg: 5.5
|
| 478 |
+
sampler_name: "euler_ancestral"
|
| 479 |
+
scheduler: "simple"
|
| 480 |
+
positive_prompt: "score_9, score_8_up, score_7_up, score_6_up, score_5_up, score_4_up, rating_safe, "
|
| 481 |
+
negative_prompt: "score_6, score_5, score_4, (worst quality:1.2), (low quality:1.2), lowres, bad anatomy, bad hands, signature, watermarks, ugly, imperfect eyes, unnatural body, extra limbs"
|
| 482 |
+
"blue_pen5805/pony_pencil-XL v2.0.0":
|
| 483 |
+
steps: 28
|
| 484 |
+
cfg: 5.5
|
| 485 |
+
sampler_name: "euler_ancestral"
|
| 486 |
+
scheduler: "simple"
|
| 487 |
+
positive_prompt: "score_9, score_8_up, score_7_up, score_6_up, score_5_up, score_4_up, rating_safe, "
|
| 488 |
+
negative_prompt: "score_6, score_5, score_4, (worst quality:1.2), (low quality:1.2), lowres, bad anatomy, bad hands, signature, watermarks, ugly, imperfect eyes, unnatural body, extra limbs"
|
| 489 |
+
"Cyberdelia/CyberRealistic Pony v17.0":
|
| 490 |
+
steps: 30
|
| 491 |
+
cfg: 5.0
|
| 492 |
+
sampler_name: "euler_ancestral"
|
| 493 |
+
scheduler: "simple"
|
| 494 |
+
positive_prompt: "score_9, score_8_up, score_7_up, rating_safe, "
|
| 495 |
+
negative_prompt: "score_6, score_5, score_4, (worst quality:1.2), (low quality:1.2), (normal quality:1.2), lowres, bad anatomy, bad hands, signature, watermarks, ugly, imperfect eyes, skewed eyes, unnatural face, unnatural body, extra limbs"
|
| 496 |
+
|
| 497 |
SD1.5:
|
| 498 |
_defaults:
|
| 499 |
+
steps: 35
|
| 500 |
cfg: 7.0
|
| 501 |
sampler_name: "euler_ancestral"
|
| 502 |
+
scheduler: "simple"
|
| 503 |
+
positive_prompt: ""
|
| 504 |
+
negative_prompt: "worst quality, low quality, normal quality, lowres, bad anatomy, bad hands, missing fingers, extra digit, cropped, blurry, watermark, signature"
|