refactor(injectors): consolidate boogu and qwen-2.1 into reference_image with flexible max_images
Browse files- chain_injectors/boogu_image_edit_injector.py +0 -73
- chain_injectors/qwen_image_2_1_edit_injector.py +0 -73
- chain_injectors/reference_image_injector.py +48 -22
- core/pipelines/pipeline_input_processor.py +0 -24
- core/pipelines/sd_image_pipeline.py +0 -4
- core/pipelines/workflow_recipes/_partials/conditioning/boogu-image.yaml +5 -5
- core/pipelines/workflow_recipes/_partials/conditioning/qwen-image-2.1.yaml +5 -4
- mcp_tools/common.py +1 -7
- ui/events/chain_handlers.py +1 -67
- ui/events/change_handlers.py +2 -6
- ui/events/main.py +3 -15
- ui/events/run_handlers.py +1 -5
- ui/imagegen_ui.py +1 -3
- ui/shared/ui_components.py +3 -61
- yaml/chain_features.yaml +2 -30
- yaml/model_architecture_features.yaml +2 -2
- yaml/task_features.yaml +0 -10
chain_injectors/boogu_image_edit_injector.py
DELETED
|
@@ -1,73 +0,0 @@
|
|
| 1 |
-
def create_node(assembler, class_type, title):
|
| 2 |
-
try:
|
| 3 |
-
node = assembler._get_node_template(class_type)
|
| 4 |
-
except Exception:
|
| 5 |
-
node = {
|
| 6 |
-
"inputs": {},
|
| 7 |
-
"class_type": class_type,
|
| 8 |
-
"_meta": {"title": title}
|
| 9 |
-
}
|
| 10 |
-
node['_meta']['title'] = title
|
| 11 |
-
return node
|
| 12 |
-
|
| 13 |
-
def inject(assembler, chain_definition, chain_items):
|
| 14 |
-
if not chain_items:
|
| 15 |
-
return
|
| 16 |
-
|
| 17 |
-
valid_images = []
|
| 18 |
-
for item in chain_items:
|
| 19 |
-
if not item:
|
| 20 |
-
continue
|
| 21 |
-
img_path = item
|
| 22 |
-
if isinstance(item, dict):
|
| 23 |
-
img_path = item.get('image') or item.get('filename') or item.get('path')
|
| 24 |
-
if img_path:
|
| 25 |
-
valid_images.append(img_path)
|
| 26 |
-
|
| 27 |
-
if not valid_images:
|
| 28 |
-
return
|
| 29 |
-
|
| 30 |
-
valid_images = valid_images[:10]
|
| 31 |
-
|
| 32 |
-
boogu_prompt_name = chain_definition.get('boogu_prompt_node', 'boogu_prompt')
|
| 33 |
-
vae_loader_name = chain_definition.get('vae_loader_node', 'vae_loader')
|
| 34 |
-
|
| 35 |
-
boogu_prompt_id = assembler.node_map.get(boogu_prompt_name)
|
| 36 |
-
if not boogu_prompt_id or boogu_prompt_id not in assembler.workflow:
|
| 37 |
-
for node_id, node in assembler.workflow.items():
|
| 38 |
-
if isinstance(node, dict) and node.get('class_type') == 'TextEncodeBooguEdit':
|
| 39 |
-
boogu_prompt_id = node_id
|
| 40 |
-
break
|
| 41 |
-
|
| 42 |
-
if not boogu_prompt_id:
|
| 43 |
-
print(f"Warning: Target node '{boogu_prompt_name}' (TextEncodeBooguEdit) for Boogu Edit chain not found. Skipping.")
|
| 44 |
-
return
|
| 45 |
-
|
| 46 |
-
vae_id = assembler.node_map.get(vae_loader_name)
|
| 47 |
-
if not vae_id:
|
| 48 |
-
for node_id, node in assembler.workflow.items():
|
| 49 |
-
if isinstance(node, dict) and node.get('class_type') == 'VAELoader':
|
| 50 |
-
vae_id = node_id
|
| 51 |
-
break
|
| 52 |
-
|
| 53 |
-
if vae_id:
|
| 54 |
-
assembler.workflow[boogu_prompt_id]['inputs']['vae'] = [vae_id, 0]
|
| 55 |
-
|
| 56 |
-
for i, img_filename in enumerate(valid_images):
|
| 57 |
-
load_id = assembler._get_unique_id()
|
| 58 |
-
load_node = create_node(assembler, "LoadImage", f"Load Reference Image {i+1}")
|
| 59 |
-
load_node['inputs']['image'] = img_filename
|
| 60 |
-
assembler.workflow[load_id] = load_node
|
| 61 |
-
|
| 62 |
-
scale_id = assembler._get_unique_id()
|
| 63 |
-
scale_node = create_node(assembler, "ImageScaleToTotalPixels", f"Scale Reference {i+1}")
|
| 64 |
-
scale_node['inputs']['upscale_method'] = "nearest-exact"
|
| 65 |
-
scale_node['inputs']['megapixels'] = 1
|
| 66 |
-
scale_node['inputs']['resolution_steps'] = 1
|
| 67 |
-
scale_node['inputs']['image'] = [load_id, 0]
|
| 68 |
-
assembler.workflow[scale_id] = scale_node
|
| 69 |
-
|
| 70 |
-
image_key = f"images.image_{i+1}"
|
| 71 |
-
assembler.workflow[boogu_prompt_id]['inputs'][image_key] = [scale_id, 0]
|
| 72 |
-
|
| 73 |
-
print(f"Boogu Edit injector applied with {len(valid_images)} reference image(s). Connected VAE dynamically.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chain_injectors/qwen_image_2_1_edit_injector.py
DELETED
|
@@ -1,73 +0,0 @@
|
|
| 1 |
-
def create_node(assembler, class_type, title):
|
| 2 |
-
try:
|
| 3 |
-
node = assembler._get_node_template(class_type)
|
| 4 |
-
except Exception:
|
| 5 |
-
node = {
|
| 6 |
-
"inputs": {},
|
| 7 |
-
"class_type": class_type,
|
| 8 |
-
"_meta": {"title": title}
|
| 9 |
-
}
|
| 10 |
-
node['_meta']['title'] = title
|
| 11 |
-
return node
|
| 12 |
-
|
| 13 |
-
def inject(assembler, chain_definition, chain_items):
|
| 14 |
-
if not chain_items:
|
| 15 |
-
return
|
| 16 |
-
|
| 17 |
-
valid_images = []
|
| 18 |
-
for item in chain_items:
|
| 19 |
-
if not item:
|
| 20 |
-
continue
|
| 21 |
-
img_path = item
|
| 22 |
-
if isinstance(item, dict):
|
| 23 |
-
img_path = item.get('image') or item.get('filename') or item.get('path')
|
| 24 |
-
if img_path:
|
| 25 |
-
valid_images.append(img_path)
|
| 26 |
-
|
| 27 |
-
if not valid_images:
|
| 28 |
-
return
|
| 29 |
-
|
| 30 |
-
valid_images = valid_images[:10]
|
| 31 |
-
|
| 32 |
-
prompt_name = chain_definition.get('prompt_node', 'prompt')
|
| 33 |
-
vae_loader_name = chain_definition.get('vae_loader_node', 'vae_loader')
|
| 34 |
-
|
| 35 |
-
prompt_id = assembler.node_map.get(prompt_name)
|
| 36 |
-
if not prompt_id or prompt_id not in assembler.workflow:
|
| 37 |
-
for node_id, node in assembler.workflow.items():
|
| 38 |
-
if isinstance(node, dict) and node.get('class_type') == 'TextEncodeQwenImage21':
|
| 39 |
-
prompt_id = node_id
|
| 40 |
-
break
|
| 41 |
-
|
| 42 |
-
if not prompt_id:
|
| 43 |
-
print(f"Warning: Target node '{prompt_name}' (TextEncodeQwenImage21) for Qwen-Image-2.1 Edit chain not found. Skipping.")
|
| 44 |
-
return
|
| 45 |
-
|
| 46 |
-
vae_id = assembler.node_map.get(vae_loader_name)
|
| 47 |
-
if not vae_id:
|
| 48 |
-
for node_id, node in assembler.workflow.items():
|
| 49 |
-
if isinstance(node, dict) and node.get('class_type') == 'VAELoader':
|
| 50 |
-
vae_id = node_id
|
| 51 |
-
break
|
| 52 |
-
|
| 53 |
-
if vae_id:
|
| 54 |
-
assembler.workflow[prompt_id]['inputs']['vae'] = [vae_id, 0]
|
| 55 |
-
|
| 56 |
-
for i, img_filename in enumerate(valid_images):
|
| 57 |
-
load_id = assembler._get_unique_id()
|
| 58 |
-
load_node = create_node(assembler, "LoadImage", f"Load Reference Image {i+1}")
|
| 59 |
-
load_node['inputs']['image'] = img_filename
|
| 60 |
-
assembler.workflow[load_id] = load_node
|
| 61 |
-
|
| 62 |
-
scale_id = assembler._get_unique_id()
|
| 63 |
-
scale_node = create_node(assembler, "ImageScaleToTotalPixels", f"Scale Reference {i+1}")
|
| 64 |
-
scale_node['inputs']['upscale_method'] = "nearest-exact"
|
| 65 |
-
scale_node['inputs']['megapixels'] = 1
|
| 66 |
-
scale_node['inputs']['resolution_steps'] = 1
|
| 67 |
-
scale_node['inputs']['image'] = [load_id, 0]
|
| 68 |
-
assembler.workflow[scale_id] = scale_node
|
| 69 |
-
|
| 70 |
-
image_key = f"images.image_{i+1}"
|
| 71 |
-
assembler.workflow[prompt_id]['inputs'][image_key] = [scale_id, 0]
|
| 72 |
-
|
| 73 |
-
print(f"Qwen-Image-2.1 Edit injector applied with {len(valid_images)} reference image(s). Connected VAE dynamically.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chain_injectors/reference_image_injector.py
CHANGED
|
@@ -1,4 +1,16 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def inject(assembler, chain_definition, chain_items):
|
| 4 |
if not chain_items:
|
|
@@ -17,48 +29,62 @@ def inject(assembler, chain_definition, chain_items):
|
|
| 17 |
if not valid_images:
|
| 18 |
return
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
for node_id, node in assembler.workflow.items():
|
| 26 |
-
if isinstance(node, dict) and node.get('class_type')
|
| 27 |
-
|
| 28 |
break
|
| 29 |
|
| 30 |
-
if not
|
| 31 |
-
print("Warning:
|
| 32 |
return
|
| 33 |
|
| 34 |
-
|
|
|
|
| 35 |
vae_node_id = assembler.node_map.get(vae_node_name)
|
| 36 |
-
if not vae_node_id:
|
| 37 |
for node_id, node in assembler.workflow.items():
|
| 38 |
if isinstance(node, dict) and node.get('class_type') == 'VAELoader':
|
| 39 |
vae_node_id = node_id
|
| 40 |
break
|
| 41 |
|
| 42 |
if vae_node_id:
|
| 43 |
-
assembler.workflow[
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
for i, img_filename in enumerate(valid_images):
|
| 46 |
load_id = assembler._get_unique_id()
|
| 47 |
-
load_node =
|
| 48 |
load_node['inputs']['image'] = img_filename
|
| 49 |
-
load_node['_meta']['title'] = f"Load Reference Image {i+1}"
|
| 50 |
assembler.workflow[load_id] = load_node
|
| 51 |
|
| 52 |
scale_id = assembler._get_unique_id()
|
| 53 |
-
scale_node =
|
| 54 |
-
scale_node['inputs']['
|
| 55 |
-
scale_node['inputs']['
|
| 56 |
-
scale_node['inputs']['resolution_steps'] =
|
| 57 |
scale_node['inputs']['image'] = [load_id, 0]
|
| 58 |
-
scale_node['_meta']['title'] = f"Scale Reference {i+1}"
|
| 59 |
assembler.workflow[scale_id] = scale_node
|
| 60 |
|
| 61 |
input_key = f"images.image_{i+1}"
|
| 62 |
-
assembler.workflow[
|
| 63 |
|
| 64 |
-
|
|
|
|
|
|
| 1 |
+
def create_node(assembler, class_type, title):
|
| 2 |
+
try:
|
| 3 |
+
node = assembler._get_node_template(class_type)
|
| 4 |
+
except Exception:
|
| 5 |
+
node = {
|
| 6 |
+
"inputs": {},
|
| 7 |
+
"class_type": class_type,
|
| 8 |
+
"_meta": {"title": title}
|
| 9 |
+
}
|
| 10 |
+
if "_meta" not in node:
|
| 11 |
+
node["_meta"] = {}
|
| 12 |
+
node['_meta']['title'] = title
|
| 13 |
+
return node
|
| 14 |
|
| 15 |
def inject(assembler, chain_definition, chain_items):
|
| 16 |
if not chain_items:
|
|
|
|
| 29 |
if not valid_images:
|
| 30 |
return
|
| 31 |
|
| 32 |
+
max_images = chain_definition.get('max_images', 10)
|
| 33 |
+
if isinstance(max_images, int) and max_images > 0:
|
| 34 |
+
valid_images = valid_images[:max_images]
|
| 35 |
+
|
| 36 |
+
# Target prompt/text_encode node resolution
|
| 37 |
+
target_node_name = (
|
| 38 |
+
chain_definition.get('text_encode_node')
|
| 39 |
+
or chain_definition.get('prompt_node')
|
| 40 |
+
or chain_definition.get('boogu_prompt_node')
|
| 41 |
+
or 'prompt'
|
| 42 |
+
)
|
| 43 |
+
target_node_id = assembler.node_map.get(target_node_name)
|
| 44 |
+
|
| 45 |
+
if not target_node_id or target_node_id not in assembler.workflow:
|
| 46 |
+
supported_types = ('TextEncodeMageFlowEdit', 'TextEncodeQwenImage21', 'TextEncodeBooguEdit')
|
| 47 |
for node_id, node in assembler.workflow.items():
|
| 48 |
+
if isinstance(node, dict) and node.get('class_type') in supported_types:
|
| 49 |
+
target_node_id = node_id
|
| 50 |
break
|
| 51 |
|
| 52 |
+
if not target_node_id or target_node_id not in assembler.workflow:
|
| 53 |
+
print(f"Warning: Target text encode node '{target_node_name}' for Reference Image chain not found. Skipping.")
|
| 54 |
return
|
| 55 |
|
| 56 |
+
# VAE loader node resolution
|
| 57 |
+
vae_node_name = chain_definition.get('vae_node') or chain_definition.get('vae_loader_node', 'vae_loader')
|
| 58 |
vae_node_id = assembler.node_map.get(vae_node_name)
|
| 59 |
+
if not vae_node_id or vae_node_id not in assembler.workflow:
|
| 60 |
for node_id, node in assembler.workflow.items():
|
| 61 |
if isinstance(node, dict) and node.get('class_type') == 'VAELoader':
|
| 62 |
vae_node_id = node_id
|
| 63 |
break
|
| 64 |
|
| 65 |
if vae_node_id:
|
| 66 |
+
assembler.workflow[target_node_id]['inputs']['vae'] = [vae_node_id, 0]
|
| 67 |
+
|
| 68 |
+
upscale_method = chain_definition.get('upscale_method', 'nearest-exact')
|
| 69 |
+
megapixels = chain_definition.get('megapixels', 1.0)
|
| 70 |
+
resolution_steps = chain_definition.get('resolution_steps', 1)
|
| 71 |
|
| 72 |
for i, img_filename in enumerate(valid_images):
|
| 73 |
load_id = assembler._get_unique_id()
|
| 74 |
+
load_node = create_node(assembler, "LoadImage", f"Load Reference Image {i+1}")
|
| 75 |
load_node['inputs']['image'] = img_filename
|
|
|
|
| 76 |
assembler.workflow[load_id] = load_node
|
| 77 |
|
| 78 |
scale_id = assembler._get_unique_id()
|
| 79 |
+
scale_node = create_node(assembler, "ImageScaleToTotalPixels", f"Scale Reference {i+1}")
|
| 80 |
+
scale_node['inputs']['upscale_method'] = upscale_method
|
| 81 |
+
scale_node['inputs']['megapixels'] = megapixels
|
| 82 |
+
scale_node['inputs']['resolution_steps'] = resolution_steps
|
| 83 |
scale_node['inputs']['image'] = [load_id, 0]
|
|
|
|
| 84 |
assembler.workflow[scale_id] = scale_node
|
| 85 |
|
| 86 |
input_key = f"images.image_{i+1}"
|
| 87 |
+
assembler.workflow[target_node_id]['inputs'][input_key] = [scale_id, 0]
|
| 88 |
|
| 89 |
+
node_class = assembler.workflow[target_node_id].get('class_type', 'Unknown')
|
| 90 |
+
print(f"Reference Image injector applied: {len(valid_images)} image(s) injected into '{target_node_id}' ({node_class}), max_images={max_images}.")
|
core/pipelines/pipeline_input_processor.py
CHANGED
|
@@ -412,28 +412,6 @@ def process_pipeline_inputs(ui_inputs: Dict[str, Any], progress: gr.Progress, wo
|
|
| 412 |
temp_files_to_clean.append(temp_path)
|
| 413 |
active_qwen_image_edit.append(os.path.basename(temp_path))
|
| 414 |
|
| 415 |
-
boogu_edit_data = ui_inputs.get('boogu_edit_data', [])
|
| 416 |
-
active_boogu_edit = []
|
| 417 |
-
if 'boogu_image_edit' in enabled_chains and boogu_edit_data:
|
| 418 |
-
for img in boogu_edit_data:
|
| 419 |
-
if img:
|
| 420 |
-
if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
|
| 421 |
-
temp_path = os.path.join(INPUT_DIR, f"temp_boogu_edit_ref_{random.randint(1000, 9999)}.png")
|
| 422 |
-
img.save(temp_path, "PNG")
|
| 423 |
-
temp_files_to_clean.append(temp_path)
|
| 424 |
-
active_boogu_edit.append(os.path.basename(temp_path))
|
| 425 |
-
|
| 426 |
-
qwen_image_2_1_edit_data = ui_inputs.get('qwen_image_2_1_edit_data', [])
|
| 427 |
-
active_qwen_image_2_1_edit = []
|
| 428 |
-
if 'qwen_image_2_1_edit' in enabled_chains and qwen_image_2_1_edit_data:
|
| 429 |
-
for img in qwen_image_2_1_edit_data:
|
| 430 |
-
if img:
|
| 431 |
-
if not os.path.exists(INPUT_DIR): os.makedirs(INPUT_DIR)
|
| 432 |
-
temp_path = os.path.join(INPUT_DIR, f"temp_qwen21_edit_ref_{random.randint(1000, 9999)}.png")
|
| 433 |
-
img.save(temp_path, "PNG")
|
| 434 |
-
temp_files_to_clean.append(temp_path)
|
| 435 |
-
active_qwen_image_2_1_edit.append(os.path.basename(temp_path))
|
| 436 |
-
|
| 437 |
reference_image_data = ui_inputs.get('reference_image_data', [])
|
| 438 |
active_reference_images = []
|
| 439 |
if 'reference_image' in enabled_chains and reference_image_data:
|
|
@@ -497,8 +475,6 @@ def process_pipeline_inputs(ui_inputs: Dict[str, Any], progress: gr.Progress, wo
|
|
| 497 |
"active_krea2_identity_edit": active_krea2_identity_edit,
|
| 498 |
"active_krea2_reference_edit": active_krea2_reference_edit,
|
| 499 |
"active_qwen_image_edit": active_qwen_image_edit,
|
| 500 |
-
"active_qwen_image_2_1_edit": active_qwen_image_2_1_edit,
|
| 501 |
-
"active_boogu_edit": active_boogu_edit,
|
| 502 |
"active_reference_images": active_reference_images,
|
| 503 |
"active_conditioning": active_conditioning,
|
| 504 |
"temp_files_to_clean": temp_files_to_clean
|
|
|
|
| 412 |
temp_files_to_clean.append(temp_path)
|
| 413 |
active_qwen_image_edit.append(os.path.basename(temp_path))
|
| 414 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 415 |
reference_image_data = ui_inputs.get('reference_image_data', [])
|
| 416 |
active_reference_images = []
|
| 417 |
if 'reference_image' in enabled_chains and reference_image_data:
|
|
|
|
| 475 |
"active_krea2_identity_edit": active_krea2_identity_edit,
|
| 476 |
"active_krea2_reference_edit": active_krea2_reference_edit,
|
| 477 |
"active_qwen_image_edit": active_qwen_image_edit,
|
|
|
|
|
|
|
| 478 |
"active_reference_images": active_reference_images,
|
| 479 |
"active_conditioning": active_conditioning,
|
| 480 |
"temp_files_to_clean": temp_files_to_clean
|
core/pipelines/sd_image_pipeline.py
CHANGED
|
@@ -120,8 +120,6 @@ class SdImagePipeline(BasePipeline):
|
|
| 120 |
active_krea2_identity_edit = processed.get("active_krea2_identity_edit", [])
|
| 121 |
active_krea2_reference_edit = processed.get("active_krea2_reference_edit", [])
|
| 122 |
active_qwen_image_edit = processed.get("active_qwen_image_edit", [])
|
| 123 |
-
active_qwen_image_2_1_edit = processed.get("active_qwen_image_2_1_edit", [])
|
| 124 |
-
active_boogu_edit = processed.get("active_boogu_edit", [])
|
| 125 |
active_reference_images = processed.get("active_reference_images", [])
|
| 126 |
active_conditioning = processed["active_conditioning"]
|
| 127 |
|
|
@@ -183,8 +181,6 @@ class SdImagePipeline(BasePipeline):
|
|
| 183 |
"krea2_identity_edit_chain": active_krea2_identity_edit,
|
| 184 |
"krea2_style_reference_chain": active_krea2_reference_edit,
|
| 185 |
"qwen_image_edit_chain": active_qwen_image_edit,
|
| 186 |
-
"qwen_image_2_1_edit_chain": active_qwen_image_2_1_edit,
|
| 187 |
-
"boogu_image_edit_chain": active_boogu_edit,
|
| 188 |
"reference_image_chain": active_reference_images,
|
| 189 |
"vae_chain": [ui_inputs.get('vae_name')] if (ui_inputs.get('vae_name') and 'vae' in enabled_chains) else [],
|
| 190 |
"hidream_o1_smoothing_chain": hidream_o1_smoothing_data,
|
|
|
|
| 120 |
active_krea2_identity_edit = processed.get("active_krea2_identity_edit", [])
|
| 121 |
active_krea2_reference_edit = processed.get("active_krea2_reference_edit", [])
|
| 122 |
active_qwen_image_edit = processed.get("active_qwen_image_edit", [])
|
|
|
|
|
|
|
| 123 |
active_reference_images = processed.get("active_reference_images", [])
|
| 124 |
active_conditioning = processed["active_conditioning"]
|
| 125 |
|
|
|
|
| 181 |
"krea2_identity_edit_chain": active_krea2_identity_edit,
|
| 182 |
"krea2_style_reference_chain": active_krea2_reference_edit,
|
| 183 |
"qwen_image_edit_chain": active_qwen_image_edit,
|
|
|
|
|
|
|
| 184 |
"reference_image_chain": active_reference_images,
|
| 185 |
"vae_chain": [ui_inputs.get('vae_name')] if (ui_inputs.get('vae_name') and 'vae' in enabled_chains) else [],
|
| 186 |
"hidream_o1_smoothing_chain": hidream_o1_smoothing_data,
|
core/pipelines/workflow_recipes/_partials/conditioning/boogu-image.yaml
CHANGED
|
@@ -49,11 +49,11 @@ dynamic_conditioning_chains:
|
|
| 49 |
ksampler_node: "ksampler"
|
| 50 |
clip_source: "clip_loader:0"
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
|
| 58 |
dynamic_pid_chains:
|
| 59 |
pid_chain:
|
|
|
|
| 49 |
ksampler_node: "ksampler"
|
| 50 |
clip_source: "clip_loader:0"
|
| 51 |
|
| 52 |
+
dynamic_reference_image_chains:
|
| 53 |
+
reference_image_chain:
|
| 54 |
+
text_encode_node: "boogu_prompt"
|
| 55 |
+
vae_node: "vae_loader"
|
| 56 |
+
max_images: 10
|
| 57 |
|
| 58 |
dynamic_pid_chains:
|
| 59 |
pid_chain:
|
core/pipelines/workflow_recipes/_partials/conditioning/qwen-image-2.1.yaml
CHANGED
|
@@ -64,10 +64,11 @@ dynamic_pid_chains:
|
|
| 64 |
pid_chain:
|
| 65 |
ksampler_node: "ksampler"
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 71 |
|
| 72 |
ui_map:
|
| 73 |
positive_prompt: "prompt:prompt"
|
|
|
|
| 64 |
pid_chain:
|
| 65 |
ksampler_node: "ksampler"
|
| 66 |
|
| 67 |
+
dynamic_reference_image_chains:
|
| 68 |
+
reference_image_chain:
|
| 69 |
+
text_encode_node: "prompt"
|
| 70 |
+
vae_node: "vae_loader"
|
| 71 |
+
max_images: 10
|
| 72 |
|
| 73 |
ui_map:
|
| 74 |
positive_prompt: "prompt:prompt"
|
mcp_tools/common.py
CHANGED
|
@@ -447,7 +447,6 @@ def _execute_imagegen_pipeline(task_id: str, params: dict):
|
|
| 447 |
reference_latent_data = []
|
| 448 |
reference_image_data = []
|
| 449 |
joyai_reference_data = []
|
| 450 |
-
boogu_edit_data = []
|
| 451 |
qwen_image_edit_data = []
|
| 452 |
hidream_o1_reference_data = []
|
| 453 |
sensenova_reference_data = []
|
|
@@ -683,7 +682,7 @@ def _execute_imagegen_pipeline(task_id: str, params: dict):
|
|
| 683 |
img = _parse_image_param(item.get("image"))
|
| 684 |
if img:
|
| 685 |
reference_latent_data.append(img)
|
| 686 |
-
elif itype in ("reference_image", "mage_flow_reference_edit"):
|
| 687 |
img = _parse_image_param(item.get("image"))
|
| 688 |
if img:
|
| 689 |
reference_image_data.append(img)
|
|
@@ -691,10 +690,6 @@ def _execute_imagegen_pipeline(task_id: str, params: dict):
|
|
| 691 |
img = _parse_image_param(item.get("image"))
|
| 692 |
if img:
|
| 693 |
joyai_reference_data.append(img)
|
| 694 |
-
elif itype in ("boogu_image_edit", "boogu_edit"):
|
| 695 |
-
img = _parse_image_param(item.get("image"))
|
| 696 |
-
if img:
|
| 697 |
-
boogu_edit_data.append(img)
|
| 698 |
elif itype == "qwen_image_edit":
|
| 699 |
img = _parse_image_param(item.get("image"))
|
| 700 |
if img:
|
|
@@ -757,7 +752,6 @@ def _execute_imagegen_pipeline(task_id: str, params: dict):
|
|
| 757 |
if reference_latent_data: ui_inputs["reference_latent_data"] = reference_latent_data
|
| 758 |
if reference_image_data: ui_inputs["reference_image_data"] = reference_image_data
|
| 759 |
if joyai_reference_data: ui_inputs["joyai_reference_data"] = joyai_reference_data
|
| 760 |
-
if boogu_edit_data: ui_inputs["boogu_edit_data"] = boogu_edit_data
|
| 761 |
if qwen_image_edit_data: ui_inputs["qwen_image_edit_data"] = qwen_image_edit_data
|
| 762 |
if hidream_o1_reference_data: ui_inputs["hidream_o1_reference_data"] = hidream_o1_reference_data
|
| 763 |
if sensenova_reference_data: ui_inputs["sensenova_reference_data"] = sensenova_reference_data
|
|
|
|
| 447 |
reference_latent_data = []
|
| 448 |
reference_image_data = []
|
| 449 |
joyai_reference_data = []
|
|
|
|
| 450 |
qwen_image_edit_data = []
|
| 451 |
hidream_o1_reference_data = []
|
| 452 |
sensenova_reference_data = []
|
|
|
|
| 682 |
img = _parse_image_param(item.get("image"))
|
| 683 |
if img:
|
| 684 |
reference_latent_data.append(img)
|
| 685 |
+
elif itype in ("reference_image", "mage_flow_reference_edit", "boogu_image_edit", "boogu_edit", "qwen_image_2_1_edit"):
|
| 686 |
img = _parse_image_param(item.get("image"))
|
| 687 |
if img:
|
| 688 |
reference_image_data.append(img)
|
|
|
|
| 690 |
img = _parse_image_param(item.get("image"))
|
| 691 |
if img:
|
| 692 |
joyai_reference_data.append(img)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 693 |
elif itype == "qwen_image_edit":
|
| 694 |
img = _parse_image_param(item.get("image"))
|
| 695 |
if img:
|
|
|
|
| 752 |
if reference_latent_data: ui_inputs["reference_latent_data"] = reference_latent_data
|
| 753 |
if reference_image_data: ui_inputs["reference_image_data"] = reference_image_data
|
| 754 |
if joyai_reference_data: ui_inputs["joyai_reference_data"] = joyai_reference_data
|
|
|
|
| 755 |
if qwen_image_edit_data: ui_inputs["qwen_image_edit_data"] = qwen_image_edit_data
|
| 756 |
if hidream_o1_reference_data: ui_inputs["hidream_o1_reference_data"] = hidream_o1_reference_data
|
| 757 |
if sensenova_reference_data: ui_inputs["sensenova_reference_data"] = sensenova_reference_data
|
ui/events/chain_handlers.py
CHANGED
|
@@ -988,70 +988,4 @@ def create_krea2_reference_edit_event_handlers(prefix, ui_components):
|
|
| 988 |
add_outputs = [count_state, add_button, del_button] + ref_rows
|
| 989 |
del_outputs = [count_state, add_button, del_button] + ref_rows + images
|
| 990 |
add_button.click(fn=add_ref_row, inputs=[count_state], outputs=add_outputs, show_progress=False)
|
| 991 |
-
del_button.click(fn=del_ref_row, inputs=[count_state], outputs=del_outputs, show_progress=False)
|
| 992 |
-
|
| 993 |
-
|
| 994 |
-
def create_boogu_edit_event_handlers(prefix, ui_components, max_units=10):
|
| 995 |
-
ref_rows = ui_components.get(f'boogu_edit_rows_{prefix}')
|
| 996 |
-
if not ref_rows: return
|
| 997 |
-
count_state = ui_components[f'boogu_edit_count_state_{prefix}']
|
| 998 |
-
add_button = ui_components[f'add_boogu_edit_button_{prefix}']
|
| 999 |
-
del_button = ui_components[f'delete_boogu_edit_button_{prefix}']
|
| 1000 |
-
images = ui_components[f'boogu_edit_images_{prefix}']
|
| 1001 |
-
|
| 1002 |
-
def add_ref_row(c):
|
| 1003 |
-
c += 1
|
| 1004 |
-
return {
|
| 1005 |
-
count_state: c,
|
| 1006 |
-
ref_rows[c - 1]: gr.update(visible=True),
|
| 1007 |
-
add_button: gr.update(visible=c < max_units),
|
| 1008 |
-
del_button: gr.update(visible=True),
|
| 1009 |
-
}
|
| 1010 |
-
|
| 1011 |
-
def del_ref_row(c):
|
| 1012 |
-
c -= 1
|
| 1013 |
-
return {
|
| 1014 |
-
count_state: c,
|
| 1015 |
-
ref_rows[c]: gr.update(visible=False),
|
| 1016 |
-
images[c]: None,
|
| 1017 |
-
add_button: gr.update(visible=True),
|
| 1018 |
-
del_button: gr.update(visible=c > 1),
|
| 1019 |
-
}
|
| 1020 |
-
|
| 1021 |
-
add_outputs = [count_state, add_button, del_button] + ref_rows
|
| 1022 |
-
del_outputs = [count_state, add_button, del_button] + ref_rows + images
|
| 1023 |
-
add_button.click(fn=add_ref_row, inputs=[count_state], outputs=add_outputs, show_progress=False)
|
| 1024 |
-
del_button.click(fn=del_ref_row, inputs=[count_state], outputs=del_outputs, show_progress=False)
|
| 1025 |
-
|
| 1026 |
-
|
| 1027 |
-
def create_qwen_image_2_1_edit_event_handlers(prefix, ui_components, max_units=10):
|
| 1028 |
-
ref_rows = ui_components.get(f'qwen_image_2_1_edit_rows_{prefix}')
|
| 1029 |
-
if not ref_rows: return
|
| 1030 |
-
count_state = ui_components[f'qwen_image_2_1_edit_count_state_{prefix}']
|
| 1031 |
-
add_button = ui_components[f'add_qwen_image_2_1_edit_button_{prefix}']
|
| 1032 |
-
del_button = ui_components[f'delete_qwen_image_2_1_edit_button_{prefix}']
|
| 1033 |
-
images = ui_components[f'qwen_image_2_1_edit_images_{prefix}']
|
| 1034 |
-
|
| 1035 |
-
def add_ref_row(c):
|
| 1036 |
-
c += 1
|
| 1037 |
-
return {
|
| 1038 |
-
count_state: c,
|
| 1039 |
-
ref_rows[c - 1]: gr.update(visible=True),
|
| 1040 |
-
add_button: gr.update(visible=c < max_units),
|
| 1041 |
-
del_button: gr.update(visible=True),
|
| 1042 |
-
}
|
| 1043 |
-
|
| 1044 |
-
def del_ref_row(c):
|
| 1045 |
-
c -= 1
|
| 1046 |
-
return {
|
| 1047 |
-
count_state: c,
|
| 1048 |
-
ref_rows[c]: gr.update(visible=False),
|
| 1049 |
-
images[c]: None,
|
| 1050 |
-
add_button: gr.update(visible=True),
|
| 1051 |
-
del_button: gr.update(visible=c > 1),
|
| 1052 |
-
}
|
| 1053 |
-
|
| 1054 |
-
add_outputs = [count_state, add_button, del_button] + ref_rows
|
| 1055 |
-
del_outputs = [count_state, add_button, del_button] + ref_rows + images
|
| 1056 |
-
add_button.click(fn=add_ref_row, inputs=[count_state], outputs=add_outputs, show_progress=False)
|
| 1057 |
-
del_button.click(fn=del_ref_row, inputs=[count_state], outputs=del_outputs, show_progress=False)
|
|
|
|
| 988 |
add_outputs = [count_state, add_button, del_button] + ref_rows
|
| 989 |
del_outputs = [count_state, add_button, del_button] + ref_rows + images
|
| 990 |
add_button.click(fn=add_ref_row, inputs=[count_state], outputs=add_outputs, show_progress=False)
|
| 991 |
+
del_button.click(fn=del_ref_row, inputs=[count_state], outputs=del_outputs, show_progress=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui/events/change_handlers.py
CHANGED
|
@@ -18,7 +18,7 @@ from .config_loaders import (
|
|
| 18 |
load_ipadapter_config
|
| 19 |
)
|
| 20 |
|
| 21 |
-
def make_update_fn(m_comp, cat_comp, ar_comp, width_comp, height_comp, cn_types, cn_series, cn_filepaths, anima_cn_types, anima_cn_series, anima_cn_filepaths, diffsynth_cn_types, diffsynth_cn_series, diffsynth_cn_filepaths, krea2_cn_types, krea2_cn_series, krea2_cn_filepaths, ipa_preset, lora_acc, cn_acc, anima_cn_acc, diffsynth_cn_acc, krea2_cn_acc, ipa_acc, sd3_ipa_acc, flux1_ipa_acc, style_acc, embed_acc, cond_acc, ref_latent_acc, hidream_o1_ref_acc, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp, pid_acc=None, vae_acc=None, joyai_ref_acc=None, krea2_identity_edit_acc=None, krea2_reference_edit_acc=None, qwen_image_edit_acc=None,
|
| 22 |
def update_fn(*args):
|
| 23 |
arch = args[0]
|
| 24 |
category = args[1]
|
|
@@ -87,8 +87,6 @@ def make_update_fn(m_comp, cat_comp, ar_comp, width_comp, height_comp, cn_types,
|
|
| 87 |
if krea2_identity_edit_acc: updates[krea2_identity_edit_acc] = gr.update(visible=('krea2_identity_edit' in enabled_chains))
|
| 88 |
if krea2_reference_edit_acc: updates[krea2_reference_edit_acc] = gr.update(visible=('krea2_style_reference' in enabled_chains))
|
| 89 |
if qwen_image_edit_acc: updates[qwen_image_edit_acc] = gr.update(visible=('qwen_image_edit' in enabled_chains))
|
| 90 |
-
if qwen_image_2_1_edit_acc: updates[qwen_image_2_1_edit_acc] = gr.update(visible=('qwen_image_2_1_edit' in enabled_chains))
|
| 91 |
-
if boogu_edit_acc: updates[boogu_edit_acc] = gr.update(visible=('boogu_image_edit' in enabled_chains))
|
| 92 |
if ref_img_acc: updates[ref_img_acc] = gr.update(visible=('reference_image' in enabled_chains))
|
| 93 |
if pid_acc: updates[pid_acc] = gr.update(visible=('pid' in enabled_chains))
|
| 94 |
if vae_acc: updates[vae_acc] = gr.update(visible=('vae' in enabled_chains))
|
|
@@ -159,7 +157,7 @@ def make_update_fn(m_comp, cat_comp, ar_comp, width_comp, height_comp, cn_types,
|
|
| 159 |
return update_fn
|
| 160 |
|
| 161 |
|
| 162 |
-
def make_model_change_fn(cat_comp_ref, ar_comp, width_comp, height_comp, cn_types, cn_series, cn_filepaths, anima_cn_types, anima_cn_series, anima_cn_filepaths, diffsynth_cn_types, diffsynth_cn_series, diffsynth_cn_filepaths, krea2_cn_types, krea2_cn_series, krea2_cn_filepaths, arch_comp_ref, ipa_preset, lora_acc, cn_acc, anima_cn_acc, diffsynth_cn_acc, krea2_cn_acc, ipa_acc, sd3_ipa_acc, flux1_ipa_acc, style_acc, embed_acc, cond_acc, ref_latent_acc, hidream_o1_ref_acc, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp, pid_acc=None, vae_acc=None, joyai_ref_acc=None, krea2_identity_edit_acc=None, krea2_reference_edit_acc=None, qwen_image_edit_acc=None,
|
| 163 |
def change_fn(*args):
|
| 164 |
model_name = args[0]
|
| 165 |
idx = 1
|
|
@@ -236,8 +234,6 @@ def make_model_change_fn(cat_comp_ref, ar_comp, width_comp, height_comp, cn_type
|
|
| 236 |
if krea2_identity_edit_acc: updates[krea2_identity_edit_acc] = gr.update(visible=('krea2_identity_edit' in enabled_chains))
|
| 237 |
if krea2_reference_edit_acc: updates[krea2_reference_edit_acc] = gr.update(visible=('krea2_style_reference' in enabled_chains))
|
| 238 |
if qwen_image_edit_acc: updates[qwen_image_edit_acc] = gr.update(visible=('qwen_image_edit' in enabled_chains))
|
| 239 |
-
if qwen_image_2_1_edit_acc: updates[qwen_image_2_1_edit_acc] = gr.update(visible=('qwen_image_2_1_edit' in enabled_chains))
|
| 240 |
-
if boogu_edit_acc: updates[boogu_edit_acc] = gr.update(visible=('boogu_image_edit' in enabled_chains))
|
| 241 |
if ref_img_acc: updates[ref_img_acc] = gr.update(visible=('reference_image' in enabled_chains))
|
| 242 |
if pid_acc: updates[pid_acc] = gr.update(visible=('pid' in enabled_chains))
|
| 243 |
if vae_acc: updates[vae_acc] = gr.update(visible=('vae' in enabled_chains))
|
|
|
|
| 18 |
load_ipadapter_config
|
| 19 |
)
|
| 20 |
|
| 21 |
+
def make_update_fn(m_comp, cat_comp, ar_comp, width_comp, height_comp, cn_types, cn_series, cn_filepaths, anima_cn_types, anima_cn_series, anima_cn_filepaths, diffsynth_cn_types, diffsynth_cn_series, diffsynth_cn_filepaths, krea2_cn_types, krea2_cn_series, krea2_cn_filepaths, ipa_preset, lora_acc, cn_acc, anima_cn_acc, diffsynth_cn_acc, krea2_cn_acc, ipa_acc, sd3_ipa_acc, flux1_ipa_acc, style_acc, embed_acc, cond_acc, ref_latent_acc, hidream_o1_ref_acc, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp, pid_acc=None, vae_acc=None, joyai_ref_acc=None, krea2_identity_edit_acc=None, krea2_reference_edit_acc=None, qwen_image_edit_acc=None, ref_img_acc=None, sensenova_ref_acc=None, task_type=None, type_comp=None):
|
| 22 |
def update_fn(*args):
|
| 23 |
arch = args[0]
|
| 24 |
category = args[1]
|
|
|
|
| 87 |
if krea2_identity_edit_acc: updates[krea2_identity_edit_acc] = gr.update(visible=('krea2_identity_edit' in enabled_chains))
|
| 88 |
if krea2_reference_edit_acc: updates[krea2_reference_edit_acc] = gr.update(visible=('krea2_style_reference' in enabled_chains))
|
| 89 |
if qwen_image_edit_acc: updates[qwen_image_edit_acc] = gr.update(visible=('qwen_image_edit' in enabled_chains))
|
|
|
|
|
|
|
| 90 |
if ref_img_acc: updates[ref_img_acc] = gr.update(visible=('reference_image' in enabled_chains))
|
| 91 |
if pid_acc: updates[pid_acc] = gr.update(visible=('pid' in enabled_chains))
|
| 92 |
if vae_acc: updates[vae_acc] = gr.update(visible=('vae' in enabled_chains))
|
|
|
|
| 157 |
return update_fn
|
| 158 |
|
| 159 |
|
| 160 |
+
def make_model_change_fn(cat_comp_ref, ar_comp, width_comp, height_comp, cn_types, cn_series, cn_filepaths, anima_cn_types, anima_cn_series, anima_cn_filepaths, diffsynth_cn_types, diffsynth_cn_series, diffsynth_cn_filepaths, krea2_cn_types, krea2_cn_series, krea2_cn_filepaths, arch_comp_ref, ipa_preset, lora_acc, cn_acc, anima_cn_acc, diffsynth_cn_acc, krea2_cn_acc, ipa_acc, sd3_ipa_acc, flux1_ipa_acc, style_acc, embed_acc, cond_acc, ref_latent_acc, hidream_o1_ref_acc, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp, pid_acc=None, vae_acc=None, joyai_ref_acc=None, krea2_identity_edit_acc=None, krea2_reference_edit_acc=None, qwen_image_edit_acc=None, ref_img_acc=None, sensenova_ref_acc=None, task_type=None, type_comp=None):
|
| 161 |
def change_fn(*args):
|
| 162 |
model_name = args[0]
|
| 163 |
idx = 1
|
|
|
|
| 234 |
if krea2_identity_edit_acc: updates[krea2_identity_edit_acc] = gr.update(visible=('krea2_identity_edit' in enabled_chains))
|
| 235 |
if krea2_reference_edit_acc: updates[krea2_reference_edit_acc] = gr.update(visible=('krea2_style_reference' in enabled_chains))
|
| 236 |
if qwen_image_edit_acc: updates[qwen_image_edit_acc] = gr.update(visible=('qwen_image_edit' in enabled_chains))
|
|
|
|
|
|
|
| 237 |
if ref_img_acc: updates[ref_img_acc] = gr.update(visible=('reference_image' in enabled_chains))
|
| 238 |
if pid_acc: updates[pid_acc] = gr.update(visible=('pid' in enabled_chains))
|
| 239 |
if vae_acc: updates[vae_acc] = gr.update(visible=('vae' in enabled_chains))
|
ui/events/main.py
CHANGED
|
@@ -18,8 +18,6 @@ from .chain_handlers import (
|
|
| 18 |
create_krea2_identity_edit_event_handlers,
|
| 19 |
create_krea2_reference_edit_event_handlers,
|
| 20 |
create_qwen_image_edit_event_handlers,
|
| 21 |
-
create_qwen_image_2_1_edit_event_handlers,
|
| 22 |
-
create_boogu_edit_event_handlers,
|
| 23 |
create_reference_image_event_handlers
|
| 24 |
)
|
| 25 |
from .change_handlers import (
|
|
@@ -79,8 +77,6 @@ def attach_event_handlers(ui_components, demo):
|
|
| 79 |
krea2_identity_edit_accordion = ui_components.get(f'krea2_identity_edit_accordion_{prefix}')
|
| 80 |
krea2_reference_edit_accordion = ui_components.get(f'krea2_reference_edit_accordion_{prefix}')
|
| 81 |
qwen_image_edit_accordion = ui_components.get(f'qwen_image_edit_accordion_{prefix}')
|
| 82 |
-
qwen_image_2_1_edit_accordion = ui_components.get(f'qwen_image_2_1_edit_accordion_{prefix}')
|
| 83 |
-
boogu_edit_accordion = ui_components.get(f'boogu_edit_accordion_{prefix}')
|
| 84 |
ref_img_accordion = ui_components.get(f'reference_image_accordion_{prefix}')
|
| 85 |
pid_accordion = ui_components.get(f'pid_accordion_{prefix}')
|
| 86 |
vae_accordion = ui_components.get(f'vae_accordion_{prefix}')
|
|
@@ -122,8 +118,6 @@ def attach_event_handlers(ui_components, demo):
|
|
| 122 |
if krea2_identity_edit_accordion: outputs.append(krea2_identity_edit_accordion)
|
| 123 |
if krea2_reference_edit_accordion: outputs.append(krea2_reference_edit_accordion)
|
| 124 |
if qwen_image_edit_accordion: outputs.append(qwen_image_edit_accordion)
|
| 125 |
-
if qwen_image_2_1_edit_accordion: outputs.append(qwen_image_2_1_edit_accordion)
|
| 126 |
-
if boogu_edit_accordion: outputs.append(boogu_edit_accordion)
|
| 127 |
if ref_img_accordion: outputs.append(ref_img_accordion)
|
| 128 |
if pid_accordion: outputs.append(pid_accordion)
|
| 129 |
if vae_accordion: outputs.append(vae_accordion)
|
|
@@ -139,7 +133,7 @@ def attach_event_handlers(ui_components, demo):
|
|
| 139 |
krea2_cn_types_list, krea2_cn_series_list, krea2_cn_filepaths_list,
|
| 140 |
ipa_preset_list, lora_accordion, cn_accordion, anima_cn_accordion, diffsynth_cn_accordion, krea2_cn_accordion, ipa_accordion, sd3_ipa_accordion, flux1_ipa_accordion, style_accordion, embedding_accordion, conditioning_accordion,
|
| 141 |
ref_latent_accordion, hidream_o1_ref_accordion, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp,
|
| 142 |
-
pid_acc=pid_accordion, vae_acc=vae_accordion, joyai_ref_acc=joyai_ref_accordion, krea2_identity_edit_acc=krea2_identity_edit_accordion, krea2_reference_edit_acc=krea2_reference_edit_accordion, qwen_image_edit_acc=qwen_image_edit_accordion,
|
| 143 |
task_type=task_type, type_comp=type_comp
|
| 144 |
)
|
| 145 |
inputs = [arch_comp, cat_comp]
|
|
@@ -177,8 +171,6 @@ def attach_event_handlers(ui_components, demo):
|
|
| 177 |
if krea2_identity_edit_accordion: outputs2.append(krea2_identity_edit_accordion)
|
| 178 |
if krea2_reference_edit_accordion: outputs2.append(krea2_reference_edit_accordion)
|
| 179 |
if qwen_image_edit_accordion: outputs2.append(qwen_image_edit_accordion)
|
| 180 |
-
if qwen_image_2_1_edit_accordion: outputs2.append(qwen_image_2_1_edit_accordion)
|
| 181 |
-
if boogu_edit_accordion: outputs2.append(boogu_edit_accordion)
|
| 182 |
if ref_img_accordion: outputs2.append(ref_img_accordion)
|
| 183 |
if pid_accordion: outputs2.append(pid_accordion)
|
| 184 |
if vae_accordion: outputs2.append(vae_accordion)
|
|
@@ -199,7 +191,7 @@ def attach_event_handlers(ui_components, demo):
|
|
| 199 |
krea2_cn_types_list, krea2_cn_series_list, krea2_cn_filepaths_list,
|
| 200 |
arch_comp, ipa_preset_list, lora_accordion, cn_accordion, anima_cn_accordion, diffsynth_cn_accordion, krea2_cn_accordion, ipa_accordion, sd3_ipa_accordion, flux1_ipa_accordion, style_accordion, embedding_accordion, conditioning_accordion,
|
| 201 |
ref_latent_accordion, hidream_o1_ref_accordion, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp,
|
| 202 |
-
pid_acc=pid_accordion, vae_acc=vae_accordion, joyai_ref_acc=joyai_ref_accordion, krea2_identity_edit_acc=krea2_identity_edit_accordion, krea2_reference_edit_acc=krea2_reference_edit_accordion, qwen_image_edit_acc=qwen_image_edit_accordion,
|
| 203 |
task_type=task_type, type_comp=type_comp
|
| 204 |
)
|
| 205 |
if type_comp:
|
|
@@ -224,8 +216,6 @@ def attach_event_handlers(ui_components, demo):
|
|
| 224 |
create_krea2_identity_edit_event_handlers(prefix, ui_components)
|
| 225 |
create_krea2_reference_edit_event_handlers(prefix, ui_components)
|
| 226 |
create_qwen_image_edit_event_handlers(prefix, ui_components)
|
| 227 |
-
create_qwen_image_2_1_edit_event_handlers(prefix, ui_components)
|
| 228 |
-
create_boogu_edit_event_handlers(prefix, ui_components)
|
| 229 |
create_reference_image_event_handlers(prefix, ui_components)
|
| 230 |
create_run_event(prefix, task_type, ui_components)
|
| 231 |
|
|
@@ -295,8 +285,6 @@ def attach_event_handlers(ui_components, demo):
|
|
| 295 |
f'krea2_identity_edit_accordion_{prefix}': 'krea2_identity_edit',
|
| 296 |
f'krea2_reference_edit_accordion_{prefix}': 'krea2_style_reference',
|
| 297 |
f'qwen_image_edit_accordion_{prefix}': 'qwen_image_edit',
|
| 298 |
-
f'qwen_image_2_1_edit_accordion_{prefix}': 'qwen_image_2_1_edit',
|
| 299 |
-
f'boogu_edit_accordion_{prefix}': 'boogu_image_edit',
|
| 300 |
f'reference_image_accordion_{prefix}': 'reference_image',
|
| 301 |
f'pid_accordion_{prefix}': 'pid',
|
| 302 |
f'vae_accordion_{prefix}': 'vae',
|
|
@@ -334,7 +322,7 @@ def attach_event_handlers(ui_components, demo):
|
|
| 334 |
'conditioning_accordion_imagegen', 'reference_latent_accordion_imagegen',
|
| 335 |
'hidream_o1_reference_accordion_imagegen', 'sensenova_reference_accordion_imagegen', 'joyai_reference_accordion_imagegen',
|
| 336 |
'krea2_identity_edit_accordion_imagegen', 'krea2_reference_edit_accordion_imagegen',
|
| 337 |
-
'qwen_image_edit_accordion_imagegen',
|
| 338 |
'reference_image_accordion_imagegen', 'pid_accordion_imagegen', 'vae_accordion_imagegen',
|
| 339 |
]
|
| 340 |
for key in accordion_keys:
|
|
|
|
| 18 |
create_krea2_identity_edit_event_handlers,
|
| 19 |
create_krea2_reference_edit_event_handlers,
|
| 20 |
create_qwen_image_edit_event_handlers,
|
|
|
|
|
|
|
| 21 |
create_reference_image_event_handlers
|
| 22 |
)
|
| 23 |
from .change_handlers import (
|
|
|
|
| 77 |
krea2_identity_edit_accordion = ui_components.get(f'krea2_identity_edit_accordion_{prefix}')
|
| 78 |
krea2_reference_edit_accordion = ui_components.get(f'krea2_reference_edit_accordion_{prefix}')
|
| 79 |
qwen_image_edit_accordion = ui_components.get(f'qwen_image_edit_accordion_{prefix}')
|
|
|
|
|
|
|
| 80 |
ref_img_accordion = ui_components.get(f'reference_image_accordion_{prefix}')
|
| 81 |
pid_accordion = ui_components.get(f'pid_accordion_{prefix}')
|
| 82 |
vae_accordion = ui_components.get(f'vae_accordion_{prefix}')
|
|
|
|
| 118 |
if krea2_identity_edit_accordion: outputs.append(krea2_identity_edit_accordion)
|
| 119 |
if krea2_reference_edit_accordion: outputs.append(krea2_reference_edit_accordion)
|
| 120 |
if qwen_image_edit_accordion: outputs.append(qwen_image_edit_accordion)
|
|
|
|
|
|
|
| 121 |
if ref_img_accordion: outputs.append(ref_img_accordion)
|
| 122 |
if pid_accordion: outputs.append(pid_accordion)
|
| 123 |
if vae_accordion: outputs.append(vae_accordion)
|
|
|
|
| 133 |
krea2_cn_types_list, krea2_cn_series_list, krea2_cn_filepaths_list,
|
| 134 |
ipa_preset_list, lora_accordion, cn_accordion, anima_cn_accordion, diffsynth_cn_accordion, krea2_cn_accordion, ipa_accordion, sd3_ipa_accordion, flux1_ipa_accordion, style_accordion, embedding_accordion, conditioning_accordion,
|
| 135 |
ref_latent_accordion, hidream_o1_ref_accordion, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp,
|
| 136 |
+
pid_acc=pid_accordion, vae_acc=vae_accordion, joyai_ref_acc=joyai_ref_accordion, krea2_identity_edit_acc=krea2_identity_edit_accordion, krea2_reference_edit_acc=krea2_reference_edit_accordion, qwen_image_edit_acc=qwen_image_edit_accordion, ref_img_acc=ref_img_accordion, sensenova_ref_acc=sensenova_ref_accordion,
|
| 137 |
task_type=task_type, type_comp=type_comp
|
| 138 |
)
|
| 139 |
inputs = [arch_comp, cat_comp]
|
|
|
|
| 171 |
if krea2_identity_edit_accordion: outputs2.append(krea2_identity_edit_accordion)
|
| 172 |
if krea2_reference_edit_accordion: outputs2.append(krea2_reference_edit_accordion)
|
| 173 |
if qwen_image_edit_accordion: outputs2.append(qwen_image_edit_accordion)
|
|
|
|
|
|
|
| 174 |
if ref_img_accordion: outputs2.append(ref_img_accordion)
|
| 175 |
if pid_accordion: outputs2.append(pid_accordion)
|
| 176 |
if vae_accordion: outputs2.append(vae_accordion)
|
|
|
|
| 191 |
krea2_cn_types_list, krea2_cn_series_list, krea2_cn_filepaths_list,
|
| 192 |
arch_comp, ipa_preset_list, lora_accordion, cn_accordion, anima_cn_accordion, diffsynth_cn_accordion, krea2_cn_accordion, ipa_accordion, sd3_ipa_accordion, flux1_ipa_accordion, style_accordion, embedding_accordion, conditioning_accordion,
|
| 193 |
ref_latent_accordion, hidream_o1_ref_accordion, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp,
|
| 194 |
+
pid_acc=pid_accordion, vae_acc=vae_accordion, joyai_ref_acc=joyai_ref_accordion, krea2_identity_edit_acc=krea2_identity_edit_accordion, krea2_reference_edit_acc=krea2_reference_edit_accordion, qwen_image_edit_acc=qwen_image_edit_accordion, ref_img_acc=ref_img_accordion, sensenova_ref_acc=sensenova_ref_accordion,
|
| 195 |
task_type=task_type, type_comp=type_comp
|
| 196 |
)
|
| 197 |
if type_comp:
|
|
|
|
| 216 |
create_krea2_identity_edit_event_handlers(prefix, ui_components)
|
| 217 |
create_krea2_reference_edit_event_handlers(prefix, ui_components)
|
| 218 |
create_qwen_image_edit_event_handlers(prefix, ui_components)
|
|
|
|
|
|
|
| 219 |
create_reference_image_event_handlers(prefix, ui_components)
|
| 220 |
create_run_event(prefix, task_type, ui_components)
|
| 221 |
|
|
|
|
| 285 |
f'krea2_identity_edit_accordion_{prefix}': 'krea2_identity_edit',
|
| 286 |
f'krea2_reference_edit_accordion_{prefix}': 'krea2_style_reference',
|
| 287 |
f'qwen_image_edit_accordion_{prefix}': 'qwen_image_edit',
|
|
|
|
|
|
|
| 288 |
f'reference_image_accordion_{prefix}': 'reference_image',
|
| 289 |
f'pid_accordion_{prefix}': 'pid',
|
| 290 |
f'vae_accordion_{prefix}': 'vae',
|
|
|
|
| 322 |
'conditioning_accordion_imagegen', 'reference_latent_accordion_imagegen',
|
| 323 |
'hidream_o1_reference_accordion_imagegen', 'sensenova_reference_accordion_imagegen', 'joyai_reference_accordion_imagegen',
|
| 324 |
'krea2_identity_edit_accordion_imagegen', 'krea2_reference_edit_accordion_imagegen',
|
| 325 |
+
'qwen_image_edit_accordion_imagegen',
|
| 326 |
'reference_image_accordion_imagegen', 'pid_accordion_imagegen', 'vae_accordion_imagegen',
|
| 327 |
]
|
| 328 |
for key in accordion_keys:
|
ui/events/run_handlers.py
CHANGED
|
@@ -87,8 +87,6 @@ def create_run_event(prefix: str, task_type: str = None, ui_components: dict = N
|
|
| 87 |
krea2_identity_edit_data_components = ui_components.get(f'all_krea2_identity_edit_components_flat_{prefix}', [])
|
| 88 |
krea2_reference_edit_data_components = ui_components.get(f'all_krea2_reference_edit_components_flat_{prefix}', [])
|
| 89 |
qwen_image_edit_data_components = ui_components.get(f'all_qwen_image_edit_components_flat_{prefix}', [])
|
| 90 |
-
qwen_image_2_1_edit_data_components = ui_components.get(f'all_qwen_image_2_1_edit_components_flat_{prefix}', [])
|
| 91 |
-
boogu_edit_data_components = ui_components.get(f'all_boogu_edit_components_flat_{prefix}', [])
|
| 92 |
reference_image_data_components = ui_components.get(f'all_reference_image_components_flat_{prefix}', [])
|
| 93 |
|
| 94 |
run_inputs_map['vae_source'] = ui_components.get(f'vae_source_{prefix}')
|
|
@@ -100,7 +98,7 @@ def create_run_event(prefix: str, task_type: str = None, ui_components: dict = N
|
|
| 100 |
all_chains = [
|
| 101 |
lora_data_components, controlnet_data_components, anima_controlnet_lllite_data_components, diffsynth_controlnet_data_components, krea2_controlnet_data_components, ipadapter_data_components,
|
| 102 |
sd3_ipadapter_data_components, flux1_ipadapter_data_components, style_data_components,
|
| 103 |
-
embedding_data_components, conditioning_data_components, reference_latent_data_components, hidream_o1_reference_data_components, sensenova_reference_data_components, joyai_reference_data_components, krea2_identity_edit_data_components, krea2_reference_edit_data_components, qwen_image_edit_data_components,
|
| 104 |
]
|
| 105 |
for chain in all_chains:
|
| 106 |
if chain:
|
|
@@ -135,8 +133,6 @@ def create_run_event(prefix: str, task_type: str = None, ui_components: dict = N
|
|
| 135 |
assign_chain_data('krea2_identity_edit_data', krea2_identity_edit_data_components)
|
| 136 |
assign_chain_data('krea2_reference_edit_data', krea2_reference_edit_data_components)
|
| 137 |
assign_chain_data('qwen_image_edit_data', qwen_image_edit_data_components)
|
| 138 |
-
assign_chain_data('qwen_image_2_1_edit_data', qwen_image_2_1_edit_data_components)
|
| 139 |
-
assign_chain_data('boogu_edit_data', boogu_edit_data_components)
|
| 140 |
assign_chain_data('reference_image_data', reference_image_data_components)
|
| 141 |
|
| 142 |
if 'ui_type' in ui_dict:
|
|
|
|
| 87 |
krea2_identity_edit_data_components = ui_components.get(f'all_krea2_identity_edit_components_flat_{prefix}', [])
|
| 88 |
krea2_reference_edit_data_components = ui_components.get(f'all_krea2_reference_edit_components_flat_{prefix}', [])
|
| 89 |
qwen_image_edit_data_components = ui_components.get(f'all_qwen_image_edit_components_flat_{prefix}', [])
|
|
|
|
|
|
|
| 90 |
reference_image_data_components = ui_components.get(f'all_reference_image_components_flat_{prefix}', [])
|
| 91 |
|
| 92 |
run_inputs_map['vae_source'] = ui_components.get(f'vae_source_{prefix}')
|
|
|
|
| 98 |
all_chains = [
|
| 99 |
lora_data_components, controlnet_data_components, anima_controlnet_lllite_data_components, diffsynth_controlnet_data_components, krea2_controlnet_data_components, ipadapter_data_components,
|
| 100 |
sd3_ipadapter_data_components, flux1_ipadapter_data_components, style_data_components,
|
| 101 |
+
embedding_data_components, conditioning_data_components, reference_latent_data_components, hidream_o1_reference_data_components, sensenova_reference_data_components, joyai_reference_data_components, krea2_identity_edit_data_components, krea2_reference_edit_data_components, qwen_image_edit_data_components, reference_image_data_components
|
| 102 |
]
|
| 103 |
for chain in all_chains:
|
| 104 |
if chain:
|
|
|
|
| 133 |
assign_chain_data('krea2_identity_edit_data', krea2_identity_edit_data_components)
|
| 134 |
assign_chain_data('krea2_reference_edit_data', krea2_reference_edit_data_components)
|
| 135 |
assign_chain_data('qwen_image_edit_data', qwen_image_edit_data_components)
|
|
|
|
|
|
|
| 136 |
assign_chain_data('reference_image_data', reference_image_data_components)
|
| 137 |
|
| 138 |
if 'ui_type' in ui_dict:
|
ui/imagegen_ui.py
CHANGED
|
@@ -8,7 +8,7 @@ from .shared.ui_components import (
|
|
| 8 |
create_conditioning_ui, create_vae_override_ui,
|
| 9 |
create_model_architecture_filter_ui, create_category_filter_ui,
|
| 10 |
create_sd3_ipadapter_ui, create_flux1_ipadapter_ui, create_style_ui,
|
| 11 |
-
create_reference_latent_ui, create_hidream_o1_reference_ui, create_sensenova_reference_ui, create_joyai_reference_ui, create_reference_image_ui, create_krea2_identity_edit_ui, create_krea2_reference_edit_ui, create_qwen_image_edit_ui,
|
| 12 |
create_pid_ui
|
| 13 |
)
|
| 14 |
|
|
@@ -189,8 +189,6 @@ def create_ui():
|
|
| 189 |
components.update(create_krea2_identity_edit_ui(prefix))
|
| 190 |
components.update(create_krea2_reference_edit_ui(prefix))
|
| 191 |
components.update(create_qwen_image_edit_ui(prefix))
|
| 192 |
-
components.update(create_qwen_image_2_1_edit_ui(prefix))
|
| 193 |
-
components.update(create_boogu_edit_ui(prefix))
|
| 194 |
components.update(create_reference_image_ui(prefix))
|
| 195 |
components.update(create_vae_override_ui(prefix))
|
| 196 |
components.update(create_pid_ui(prefix))
|
|
|
|
| 8 |
create_conditioning_ui, create_vae_override_ui,
|
| 9 |
create_model_architecture_filter_ui, create_category_filter_ui,
|
| 10 |
create_sd3_ipadapter_ui, create_flux1_ipadapter_ui, create_style_ui,
|
| 11 |
+
create_reference_latent_ui, create_hidream_o1_reference_ui, create_sensenova_reference_ui, create_joyai_reference_ui, create_reference_image_ui, create_krea2_identity_edit_ui, create_krea2_reference_edit_ui, create_qwen_image_edit_ui,
|
| 12 |
create_pid_ui
|
| 13 |
)
|
| 14 |
|
|
|
|
| 189 |
components.update(create_krea2_identity_edit_ui(prefix))
|
| 190 |
components.update(create_krea2_reference_edit_ui(prefix))
|
| 191 |
components.update(create_qwen_image_edit_ui(prefix))
|
|
|
|
|
|
|
| 192 |
components.update(create_reference_image_ui(prefix))
|
| 193 |
components.update(create_vae_override_ui(prefix))
|
| 194 |
components.update(create_pid_ui(prefix))
|
ui/shared/ui_components.py
CHANGED
|
@@ -755,9 +755,9 @@ def create_reference_image_ui(prefix: str, max_units=10):
|
|
| 755 |
components = {}
|
| 756 |
key = lambda name: f"{name}_{prefix}"
|
| 757 |
|
| 758 |
-
with gr.Accordion("
|
| 759 |
components[key('reference_image_accordion')] = ref_accordion
|
| 760 |
-
gr.Markdown("💡 **Tip:**
|
| 761 |
|
| 762 |
ref_image_groups = []
|
| 763 |
ref_image_inputs = []
|
|
@@ -882,62 +882,4 @@ def create_krea2_reference_edit_ui(prefix: str, max_units=3):
|
|
| 882 |
|
| 883 |
components[key('all_krea2_reference_edit_components_flat')] = ref_image_inputs
|
| 884 |
|
| 885 |
-
return components
|
| 886 |
-
|
| 887 |
-
def create_boogu_edit_ui(prefix: str, max_units=10):
|
| 888 |
-
components = {}
|
| 889 |
-
key = lambda name: f"{name}_{prefix}"
|
| 890 |
-
|
| 891 |
-
with gr.Accordion("Boogu-Image Edit Settings", open=False, visible=('boogu_image_edit' in default_enabled_chains)) as ref_accordion:
|
| 892 |
-
components[key('boogu_edit_accordion')] = ref_accordion
|
| 893 |
-
gr.Markdown("💡 **Tip:** (Boogu-Image-Edit-Turbo/Boogu-Image-Edit recommended, Boogu-Image-Edit need set ZeroGPU Duration (s) to 120 ) In txt2img mode, adding a single reference image performs an **Image Edit**, while adding multiple images performs an **Image Combine**.")
|
| 894 |
-
|
| 895 |
-
ref_image_groups = []
|
| 896 |
-
ref_image_inputs = []
|
| 897 |
-
with gr.Row():
|
| 898 |
-
for i in range(max_units):
|
| 899 |
-
with gr.Column(visible=(i < 1), min_width=160) as img_col:
|
| 900 |
-
img_comp = gr.Image(type="pil", label=f"Ref. {i+1}", sources=["upload"], height=150)
|
| 901 |
-
ref_image_groups.append(img_col)
|
| 902 |
-
ref_image_inputs.append(img_comp)
|
| 903 |
-
|
| 904 |
-
components[key('boogu_edit_rows')] = ref_image_groups
|
| 905 |
-
components[key('boogu_edit_images')] = ref_image_inputs
|
| 906 |
-
|
| 907 |
-
with gr.Row():
|
| 908 |
-
components[key('add_boogu_edit_button')] = gr.Button("✚ Add Reference Image")
|
| 909 |
-
components[key('delete_boogu_edit_button')] = gr.Button("➖ Delete Reference Image", visible=False)
|
| 910 |
-
components[key('boogu_edit_count_state')] = gr.State(1)
|
| 911 |
-
|
| 912 |
-
components[key('all_boogu_edit_components_flat')] = ref_image_inputs
|
| 913 |
-
|
| 914 |
-
return components
|
| 915 |
-
|
| 916 |
-
def create_qwen_image_2_1_edit_ui(prefix: str, max_units=10):
|
| 917 |
-
components = {}
|
| 918 |
-
key = lambda name: f"{name}_{prefix}"
|
| 919 |
-
|
| 920 |
-
with gr.Accordion("Qwen-Image-2.1 Edit Settings", open=False, visible=('qwen_image_2_1_edit' in default_enabled_chains)) as ref_accordion:
|
| 921 |
-
components[key('qwen_image_2_1_edit_accordion')] = ref_accordion
|
| 922 |
-
gr.Markdown("💡 **Tip:** For Qwen-Image-2.1 models, this feature enables reference image editing and combining capabilities. In txt2img mode, adding a single reference image performs an **Image Edit**, while adding multiple images performs an **Image Combine**.")
|
| 923 |
-
|
| 924 |
-
ref_image_groups = []
|
| 925 |
-
ref_image_inputs = []
|
| 926 |
-
with gr.Row():
|
| 927 |
-
for i in range(max_units):
|
| 928 |
-
with gr.Column(visible=(i < 1), min_width=160) as img_col:
|
| 929 |
-
img_comp = gr.Image(type="pil", label=f"Ref. {i+1}", sources=["upload"], height=150)
|
| 930 |
-
ref_image_groups.append(img_col)
|
| 931 |
-
ref_image_inputs.append(img_comp)
|
| 932 |
-
|
| 933 |
-
components[key('qwen_image_2_1_edit_rows')] = ref_image_groups
|
| 934 |
-
components[key('qwen_image_2_1_edit_images')] = ref_image_inputs
|
| 935 |
-
|
| 936 |
-
with gr.Row():
|
| 937 |
-
components[key('add_qwen_image_2_1_edit_button')] = gr.Button("✚ Add Reference Image")
|
| 938 |
-
components[key('delete_qwen_image_2_1_edit_button')] = gr.Button("➖ Delete Reference Image", visible=False)
|
| 939 |
-
components[key('qwen_image_2_1_edit_count_state')] = gr.State(1)
|
| 940 |
-
|
| 941 |
-
components[key('all_qwen_image_2_1_edit_components_flat')] = ref_image_inputs
|
| 942 |
-
|
| 943 |
-
return components
|
|
|
|
| 755 |
components = {}
|
| 756 |
key = lambda name: f"{name}_{prefix}"
|
| 757 |
|
| 758 |
+
with gr.Accordion("Reference Image Edit Settings", open=False, visible=('reference_image' in default_enabled_chains)) as ref_accordion:
|
| 759 |
components[key('reference_image_accordion')] = ref_accordion
|
| 760 |
+
gr.Markdown("💡 **Tip:** For multimodal models, this feature enables powerful editing and combining capabilities. In txt2img mode, adding a single reference image performs an **Image Edit**, while adding multiple images performs an **Image Combine**.")
|
| 761 |
|
| 762 |
ref_image_groups = []
|
| 763 |
ref_image_inputs = []
|
|
|
|
| 882 |
|
| 883 |
components[key('all_krea2_reference_edit_components_flat')] = ref_image_inputs
|
| 884 |
|
| 885 |
+
return components
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yaml/chain_features.yaml
CHANGED
|
@@ -223,8 +223,8 @@ reference_edit:
|
|
| 223 |
|
| 224 |
mage_flow_reference_edit:
|
| 225 |
chains: reference_image
|
| 226 |
-
display_name: "
|
| 227 |
-
description: "
|
| 228 |
max_count: 10
|
| 229 |
usage_guideline: "Supply reference image as Base64 Data URI or HTTP/HTTPS URL."
|
| 230 |
parameters_schema:
|
|
@@ -293,20 +293,6 @@ diffsynth_controlnet:
|
|
| 293 |
- series
|
| 294 |
- image
|
| 295 |
|
| 296 |
-
boogu_image_edit:
|
| 297 |
-
chains: boogu_image_edit
|
| 298 |
-
display_name: "Boogu-Image Edit"
|
| 299 |
-
description: " (Boogu-Image-Edit-Turbo/Boogu-Image-Edit recommended, Boogu-Image-Edit need set ZeroGPU Duration (s) to 120 ) In txt2img mode, adding a single reference image performs an Image Edit, while adding multiple images performs an Image Combine."
|
| 300 |
-
max_count: 2
|
| 301 |
-
usage_guideline: "Supply reference image as Base64 Data URI or HTTP/HTTPS URL."
|
| 302 |
-
parameters_schema:
|
| 303 |
-
type: object
|
| 304 |
-
properties:
|
| 305 |
-
image:
|
| 306 |
-
type: string
|
| 307 |
-
description: "Reference image encoded as Base64 Data URI or HTTP/HTTPS URL."
|
| 308 |
-
required:
|
| 309 |
-
- image
|
| 310 |
|
| 311 |
joyai_reference_edit:
|
| 312 |
chains: joyai_image
|
|
@@ -338,20 +324,6 @@ qwen_image_edit:
|
|
| 338 |
required:
|
| 339 |
- image
|
| 340 |
|
| 341 |
-
qwen_image_2_1_edit:
|
| 342 |
-
chains: qwen_image_2_1_edit
|
| 343 |
-
display_name: "Qwen-Image-2.1 Edit"
|
| 344 |
-
description: "For Qwen-Image-2.1 models, this feature enables reference image editing and combining capabilities. In txt2img mode, adding a single reference image performs an Image Edit, while adding multiple images performs an Image Combine."
|
| 345 |
-
max_count: 10
|
| 346 |
-
usage_guideline: "Supply reference image(s) (up to 10) encoded as Base64 Data URI or HTTP/HTTPS URL. Passing reference image(s) scales them to 1MP via nearest-exact method and feeds them dynamically into TextEncodeQwenImage21."
|
| 347 |
-
parameters_schema:
|
| 348 |
-
type: object
|
| 349 |
-
properties:
|
| 350 |
-
image:
|
| 351 |
-
type: string
|
| 352 |
-
description: "Reference image encoded as Base64 Data URI or HTTP/HTTPS URL."
|
| 353 |
-
required:
|
| 354 |
-
- image
|
| 355 |
|
| 356 |
hidream_o1_smoothing:
|
| 357 |
chains: hidream_o1_smoothing
|
|
|
|
| 223 |
|
| 224 |
mage_flow_reference_edit:
|
| 225 |
chains: reference_image
|
| 226 |
+
display_name: "Reference Image Edit"
|
| 227 |
+
description: "For multimodal models, this feature enables reference image editing and combining capabilities. In txt2img mode, adding a single reference image performs an Image Edit, while adding multiple images performs an Image Combine."
|
| 228 |
max_count: 10
|
| 229 |
usage_guideline: "Supply reference image as Base64 Data URI or HTTP/HTTPS URL."
|
| 230 |
parameters_schema:
|
|
|
|
| 293 |
- series
|
| 294 |
- image
|
| 295 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
|
| 297 |
joyai_reference_edit:
|
| 298 |
chains: joyai_image
|
|
|
|
| 324 |
required:
|
| 325 |
- image
|
| 326 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
|
| 328 |
hidream_o1_smoothing:
|
| 329 |
chains: hidream_o1_smoothing
|
yaml/model_architecture_features.yaml
CHANGED
|
@@ -24,7 +24,7 @@ joyai-image:
|
|
| 24 |
boogu-image:
|
| 25 |
enabled_chains:
|
| 26 |
- lora
|
| 27 |
-
-
|
| 28 |
- pid
|
| 29 |
|
| 30 |
pixeldit:
|
|
@@ -73,7 +73,7 @@ z-image:
|
|
| 73 |
qwen-image-2.1:
|
| 74 |
enabled_chains:
|
| 75 |
- lora
|
| 76 |
-
-
|
| 77 |
|
| 78 |
qwen-image:
|
| 79 |
enabled_chains:
|
|
|
|
| 24 |
boogu-image:
|
| 25 |
enabled_chains:
|
| 26 |
- lora
|
| 27 |
+
- reference_image
|
| 28 |
- pid
|
| 29 |
|
| 30 |
pixeldit:
|
|
|
|
| 73 |
qwen-image-2.1:
|
| 74 |
enabled_chains:
|
| 75 |
- lora
|
| 76 |
+
- reference_image
|
| 77 |
|
| 78 |
qwen-image:
|
| 79 |
enabled_chains:
|
yaml/task_features.yaml
CHANGED
|
@@ -24,8 +24,6 @@ txt2img:
|
|
| 24 |
- krea2_identity_edit
|
| 25 |
- krea2_style_reference
|
| 26 |
- qwen_image_edit
|
| 27 |
-
- qwen_image_2_1_edit
|
| 28 |
-
- boogu_image_edit
|
| 29 |
- reference_image
|
| 30 |
- pid
|
| 31 |
- vae
|
|
@@ -51,8 +49,6 @@ img2img:
|
|
| 51 |
- krea2_identity_edit
|
| 52 |
- krea2_style_reference
|
| 53 |
- qwen_image_edit
|
| 54 |
-
- qwen_image_2_1_edit
|
| 55 |
-
- boogu_image_edit
|
| 56 |
- reference_image
|
| 57 |
- vae
|
| 58 |
|
|
@@ -77,8 +73,6 @@ inpaint:
|
|
| 77 |
- krea2_identity_edit
|
| 78 |
- krea2_style_reference
|
| 79 |
- qwen_image_edit
|
| 80 |
-
- qwen_image_2_1_edit
|
| 81 |
-
- boogu_image_edit
|
| 82 |
- reference_image
|
| 83 |
- vae
|
| 84 |
|
|
@@ -103,8 +97,6 @@ outpaint:
|
|
| 103 |
- krea2_identity_edit
|
| 104 |
- krea2_style_reference
|
| 105 |
- qwen_image_edit
|
| 106 |
-
- qwen_image_2_1_edit
|
| 107 |
-
- boogu_image_edit
|
| 108 |
- reference_image
|
| 109 |
- vae
|
| 110 |
|
|
@@ -129,7 +121,5 @@ hires_fix:
|
|
| 129 |
- krea2_identity_edit
|
| 130 |
- krea2_style_reference
|
| 131 |
- qwen_image_edit
|
| 132 |
-
- qwen_image_2_1_edit
|
| 133 |
-
- boogu_image_edit
|
| 134 |
- reference_image
|
| 135 |
- vae
|
|
|
|
| 24 |
- krea2_identity_edit
|
| 25 |
- krea2_style_reference
|
| 26 |
- qwen_image_edit
|
|
|
|
|
|
|
| 27 |
- reference_image
|
| 28 |
- pid
|
| 29 |
- vae
|
|
|
|
| 49 |
- krea2_identity_edit
|
| 50 |
- krea2_style_reference
|
| 51 |
- qwen_image_edit
|
|
|
|
|
|
|
| 52 |
- reference_image
|
| 53 |
- vae
|
| 54 |
|
|
|
|
| 73 |
- krea2_identity_edit
|
| 74 |
- krea2_style_reference
|
| 75 |
- qwen_image_edit
|
|
|
|
|
|
|
| 76 |
- reference_image
|
| 77 |
- vae
|
| 78 |
|
|
|
|
| 97 |
- krea2_identity_edit
|
| 98 |
- krea2_style_reference
|
| 99 |
- qwen_image_edit
|
|
|
|
|
|
|
| 100 |
- reference_image
|
| 101 |
- vae
|
| 102 |
|
|
|
|
| 121 |
- krea2_identity_edit
|
| 122 |
- krea2_style_reference
|
| 123 |
- qwen_image_edit
|
|
|
|
|
|
|
| 124 |
- reference_image
|
| 125 |
- vae
|