RioShiina commited on
Commit
1ed9537
·
verified ·
1 Parent(s): c44ea3c

Add Qwen-Image-2.1 architecture model.

Browse files
README.md CHANGED
@@ -57,6 +57,7 @@ models:
57
  - Comfy-Org/Ovis-Image
58
  - Comfy-Org/PixelDiT
59
  - Comfy-Org/Qwen-Image_ComfyUI
 
60
  - Comfy-Org/Qwen-Image-Edit_ComfyUI
61
  - Comfy-Org/sigclip_vision_384
62
  - Comfy-Org/stable-diffusion-3.5-fp8
@@ -170,6 +171,7 @@ models:
170
  - OmniGen2/OmniGen2
171
  - Qwen/Qwen-Image
172
  - Qwen/Qwen-Image-2512
 
173
  - Qwen/Qwen-Image-Edit
174
  - Qwen/Qwen-Image-Edit-2509
175
  - Qwen/Qwen-Image-Edit-2511
 
57
  - Comfy-Org/Ovis-Image
58
  - Comfy-Org/PixelDiT
59
  - Comfy-Org/Qwen-Image_ComfyUI
60
+ - Comfy-Org/Qwen-Image-2.1
61
  - Comfy-Org/Qwen-Image-Edit_ComfyUI
62
  - Comfy-Org/sigclip_vision_384
63
  - Comfy-Org/stable-diffusion-3.5-fp8
 
171
  - OmniGen2/OmniGen2
172
  - Qwen/Qwen-Image
173
  - Qwen/Qwen-Image-2512
174
+ - Qwen/Qwen-Image-2.1
175
  - Qwen/Qwen-Image-Edit
176
  - Qwen/Qwen-Image-Edit-2509
177
  - Qwen/Qwen-Image-Edit-2511
chain_injectors/qwen_image_2_1_edit_injector.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.")
core/pipelines/pipeline_input_processor.py CHANGED
@@ -423,6 +423,17 @@ def process_pipeline_inputs(ui_inputs: Dict[str, Any], progress: gr.Progress, wo
423
  temp_files_to_clean.append(temp_path)
424
  active_boogu_edit.append(os.path.basename(temp_path))
425
 
 
 
 
 
 
 
 
 
 
 
 
426
  reference_image_data = ui_inputs.get('reference_image_data', [])
427
  active_reference_images = []
428
  if 'reference_image' in enabled_chains and reference_image_data:
@@ -486,6 +497,7 @@ def process_pipeline_inputs(ui_inputs: Dict[str, Any], progress: gr.Progress, wo
486
  "active_krea2_identity_edit": active_krea2_identity_edit,
487
  "active_krea2_reference_edit": active_krea2_reference_edit,
488
  "active_qwen_image_edit": active_qwen_image_edit,
 
489
  "active_boogu_edit": active_boogu_edit,
490
  "active_reference_images": active_reference_images,
491
  "active_conditioning": active_conditioning,
 
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
  "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,
core/pipelines/sd_image_pipeline.py CHANGED
@@ -120,6 +120,7 @@ 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_boogu_edit = processed.get("active_boogu_edit", [])
124
  active_reference_images = processed.get("active_reference_images", [])
125
  active_conditioning = processed["active_conditioning"]
@@ -182,6 +183,7 @@ class SdImagePipeline(BasePipeline):
182
  "krea2_identity_edit_chain": active_krea2_identity_edit,
183
  "krea2_style_reference_chain": active_krea2_reference_edit,
184
  "qwen_image_edit_chain": active_qwen_image_edit,
 
185
  "boogu_image_edit_chain": active_boogu_edit,
186
  "reference_image_chain": active_reference_images,
187
  "vae_chain": [ui_inputs.get('vae_name')] if (ui_inputs.get('vae_name') and 'vae' in enabled_chains) else [],
 
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"]
 
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 [],
core/pipelines/workflow_recipes/_partials/conditioning/qwen-image-2.1.yaml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nodes:
2
+ prompt:
3
+ class_type: TextEncodeQwenImage21
4
+ title: "Text Encode Qwen Image 2.1"
5
+ params:
6
+ resolution: 1024
7
+ unet_loader:
8
+ class_type: UNETLoader
9
+ title: "Load Diffusion Model"
10
+ params:
11
+ weight_dtype: "default"
12
+ vae_loader:
13
+ class_type: VAELoader
14
+ title: "Load VAE"
15
+ clip_loader:
16
+ class_type: CLIPLoader
17
+ title: "Load CLIP"
18
+ params:
19
+ type: "qwen_image"
20
+ device: "default"
21
+
22
+ connections:
23
+ - from: "unet_loader:0"
24
+ to: "ksampler:model"
25
+
26
+ - from: "clip_loader:0"
27
+ to: "prompt:clip"
28
+
29
+ - from: "vae_loader:0"
30
+ to: "vae_decode:vae"
31
+ - from: "vae_loader:0"
32
+ to: "vae_encode:vae"
33
+
34
+ - from: "prompt:0"
35
+ to: "ksampler:positive"
36
+ - from: "prompt:1"
37
+ to: "ksampler:negative"
38
+
39
+ dynamic_lora_chains:
40
+ lora_chain:
41
+ template: "LoraLoader"
42
+ output_map:
43
+ "unet_loader:0": "model"
44
+ "clip_loader:0": "clip"
45
+ input_map:
46
+ "model": "model"
47
+ "clip": "clip"
48
+ end_input_map:
49
+ "model": ["ksampler:model"]
50
+ "clip": ["prompt:clip"]
51
+
52
+ dynamic_controlnet_chains:
53
+ controlnet_chain:
54
+ template: "ControlNetApplyAdvanced"
55
+ ksampler_node: "ksampler"
56
+ vae_source: "vae_loader:0"
57
+
58
+ dynamic_conditioning_chains:
59
+ conditioning_chain:
60
+ ksampler_node: "ksampler"
61
+ clip_source: "clip_loader:0"
62
+
63
+ dynamic_pid_chains:
64
+ pid_chain:
65
+ ksampler_node: "ksampler"
66
+
67
+ dynamic_qwen_image_2_1_edit_chains:
68
+ qwen_image_2_1_edit_chain:
69
+ prompt_node: "prompt"
70
+ vae_loader_node: "vae_loader"
71
+
72
+ ui_map:
73
+ positive_prompt: "prompt:prompt"
74
+ negative_prompt: "prompt:negative_prompt"
75
+ unet_name: "unet_loader:unet_name"
76
+ vae_name: "vae_loader:vae_name"
77
+ clip_name: "clip_loader:clip_name"
78
+ scheduler_width: "prompt:resolution"
requirements.txt CHANGED
@@ -1,46 +1,46 @@
1
- comfyui-frontend-package==1.52.7
2
- comfyui-workflow-templates==0.11.62
3
- comfyui-embedded-docs==0.5.11
4
- torch
5
- torchsde
6
- torchvision
7
- torchaudio
8
- numpy>=1.25.0
9
- einops
10
- transformers>=4.50.3
11
- tokenizers>=0.13.3
12
- sentencepiece
13
- safetensors>=0.4.2
14
- aiohttp>=3.11.8
15
- yarl>=1.18.0
16
- pyyaml
17
- Pillow
18
- scipy
19
- tqdm
20
- psutil
21
- alembic
22
- SQLAlchemy>=2.0.0
23
- filelock
24
- av>=17.0.0
25
- comfy-kitchen==0.2.34
26
- comfy-aimdo==0.5.5
27
- requests
28
- simpleeval>=1.0.0
29
- blake3
30
-
31
- #non essential dependencies:
32
- kornia>=0.7.1
33
- spandrel
34
- pydantic~=2.0
35
- pydantic-settings~=2.0
36
- PyOpenGL>=3.1.8
37
- comfy-angle
38
-
39
-
40
- diffusers
41
- protobuf
42
- insightface
43
- huggingface-hub
44
- imageio
45
- spaces
46
  sageattention @ https://huggingface.co/RioShiina/Sage-Attention-ZeroGPU-Space-Build/resolve/main/sageattention-2.2.0-cp312-cp312-linux_x86_64.whl
 
1
+ comfyui-frontend-package==1.53.6
2
+ comfyui-workflow-templates==0.11.66
3
+ comfyui-embedded-docs==0.5.12
4
+ torch
5
+ torchsde
6
+ torchvision
7
+ torchaudio
8
+ numpy>=1.25.0
9
+ einops
10
+ transformers>=4.50.3
11
+ tokenizers>=0.13.3
12
+ sentencepiece
13
+ safetensors>=0.4.2
14
+ aiohttp>=3.11.8
15
+ yarl>=1.18.0
16
+ pyyaml
17
+ Pillow
18
+ scipy
19
+ tqdm
20
+ psutil
21
+ alembic
22
+ SQLAlchemy>=2.0.0
23
+ filelock
24
+ av>=17.0.0
25
+ comfy-kitchen==0.2.35
26
+ comfy-aimdo==0.5.5
27
+ requests
28
+ simpleeval>=1.0.0
29
+ blake3
30
+
31
+ #non essential dependencies:
32
+ kornia>=0.7.1
33
+ spandrel
34
+ pydantic~=2.0
35
+ pydantic-settings~=2.0
36
+ PyOpenGL>=3.1.8
37
+ comfy-angle
38
+
39
+
40
+ diffusers
41
+ protobuf
42
+ insightface
43
+ huggingface-hub
44
+ imageio
45
+ spaces
46
  sageattention @ https://huggingface.co/RioShiina/Sage-Attention-ZeroGPU-Space-Build/resolve/main/sageattention-2.2.0-cp312-cp312-linux_x86_64.whl
ui/events/chain_handlers.py CHANGED
@@ -999,6 +999,39 @@ def create_boogu_edit_event_handlers(prefix, ui_components, max_units=10):
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 {
 
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 {
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, boogu_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,6 +87,7 @@ 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 boogu_edit_acc: updates[boogu_edit_acc] = gr.update(visible=('boogu_image_edit' in enabled_chains))
91
  if ref_img_acc: updates[ref_img_acc] = gr.update(visible=('reference_image' in enabled_chains))
92
  if pid_acc: updates[pid_acc] = gr.update(visible=('pid' in enabled_chains))
@@ -158,7 +159,7 @@ def make_update_fn(m_comp, cat_comp, ar_comp, width_comp, height_comp, cn_types,
158
  return update_fn
159
 
160
 
161
- 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, boogu_edit_acc=None, ref_img_acc=None, sensenova_ref_acc=None, task_type=None, type_comp=None):
162
  def change_fn(*args):
163
  model_name = args[0]
164
  idx = 1
@@ -235,6 +236,7 @@ def make_model_change_fn(cat_comp_ref, ar_comp, width_comp, height_comp, cn_type
235
  if krea2_identity_edit_acc: updates[krea2_identity_edit_acc] = gr.update(visible=('krea2_identity_edit' in enabled_chains))
236
  if krea2_reference_edit_acc: updates[krea2_reference_edit_acc] = gr.update(visible=('krea2_style_reference' in enabled_chains))
237
  if qwen_image_edit_acc: updates[qwen_image_edit_acc] = gr.update(visible=('qwen_image_edit' in enabled_chains))
 
238
  if boogu_edit_acc: updates[boogu_edit_acc] = gr.update(visible=('boogu_image_edit' in enabled_chains))
239
  if ref_img_acc: updates[ref_img_acc] = gr.update(visible=('reference_image' in enabled_chains))
240
  if pid_acc: updates[pid_acc] = gr.update(visible=('pid' 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, qwen_image_2_1_edit_acc=None, boogu_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 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))
 
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, qwen_image_2_1_edit_acc=None, boogu_edit_acc=None, ref_img_acc=None, sensenova_ref_acc=None, task_type=None, type_comp=None):
163
  def change_fn(*args):
164
  model_name = args[0]
165
  idx = 1
 
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))
ui/events/main.py CHANGED
@@ -18,6 +18,7 @@ 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_boogu_edit_event_handlers,
22
  create_reference_image_event_handlers
23
  )
@@ -78,6 +79,7 @@ def attach_event_handlers(ui_components, demo):
78
  krea2_identity_edit_accordion = ui_components.get(f'krea2_identity_edit_accordion_{prefix}')
79
  krea2_reference_edit_accordion = ui_components.get(f'krea2_reference_edit_accordion_{prefix}')
80
  qwen_image_edit_accordion = ui_components.get(f'qwen_image_edit_accordion_{prefix}')
 
81
  boogu_edit_accordion = ui_components.get(f'boogu_edit_accordion_{prefix}')
82
  ref_img_accordion = ui_components.get(f'reference_image_accordion_{prefix}')
83
  pid_accordion = ui_components.get(f'pid_accordion_{prefix}')
@@ -120,6 +122,7 @@ def attach_event_handlers(ui_components, demo):
120
  if krea2_identity_edit_accordion: outputs.append(krea2_identity_edit_accordion)
121
  if krea2_reference_edit_accordion: outputs.append(krea2_reference_edit_accordion)
122
  if qwen_image_edit_accordion: outputs.append(qwen_image_edit_accordion)
 
123
  if boogu_edit_accordion: outputs.append(boogu_edit_accordion)
124
  if ref_img_accordion: outputs.append(ref_img_accordion)
125
  if pid_accordion: outputs.append(pid_accordion)
@@ -136,7 +139,7 @@ def attach_event_handlers(ui_components, demo):
136
  krea2_cn_types_list, krea2_cn_series_list, krea2_cn_filepaths_list,
137
  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,
138
  ref_latent_accordion, hidream_o1_ref_accordion, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp,
139
- 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, boogu_edit_acc=boogu_edit_accordion, ref_img_acc=ref_img_accordion, sensenova_ref_acc=sensenova_ref_accordion,
140
  task_type=task_type, type_comp=type_comp
141
  )
142
  inputs = [arch_comp, cat_comp]
@@ -174,6 +177,7 @@ def attach_event_handlers(ui_components, demo):
174
  if krea2_identity_edit_accordion: outputs2.append(krea2_identity_edit_accordion)
175
  if krea2_reference_edit_accordion: outputs2.append(krea2_reference_edit_accordion)
176
  if qwen_image_edit_accordion: outputs2.append(qwen_image_edit_accordion)
 
177
  if boogu_edit_accordion: outputs2.append(boogu_edit_accordion)
178
  if ref_img_accordion: outputs2.append(ref_img_accordion)
179
  if pid_accordion: outputs2.append(pid_accordion)
@@ -195,7 +199,7 @@ def attach_event_handlers(ui_components, demo):
195
  krea2_cn_types_list, krea2_cn_series_list, krea2_cn_filepaths_list,
196
  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,
197
  ref_latent_accordion, hidream_o1_ref_accordion, prompt_comp, neg_prompt_comp, steps_comp, cfg_comp, sampler_comp, scheduler_comp,
198
- 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, boogu_edit_acc=boogu_edit_accordion, ref_img_acc=ref_img_accordion, sensenova_ref_acc=sensenova_ref_accordion,
199
  task_type=task_type, type_comp=type_comp
200
  )
201
  if type_comp:
@@ -220,6 +224,7 @@ def attach_event_handlers(ui_components, demo):
220
  create_krea2_identity_edit_event_handlers(prefix, ui_components)
221
  create_krea2_reference_edit_event_handlers(prefix, ui_components)
222
  create_qwen_image_edit_event_handlers(prefix, ui_components)
 
223
  create_boogu_edit_event_handlers(prefix, ui_components)
224
  create_reference_image_event_handlers(prefix, ui_components)
225
  create_run_event(prefix, task_type, ui_components)
@@ -290,6 +295,7 @@ def attach_event_handlers(ui_components, demo):
290
  f'krea2_identity_edit_accordion_{prefix}': 'krea2_identity_edit',
291
  f'krea2_reference_edit_accordion_{prefix}': 'krea2_style_reference',
292
  f'qwen_image_edit_accordion_{prefix}': 'qwen_image_edit',
 
293
  f'boogu_edit_accordion_{prefix}': 'boogu_image_edit',
294
  f'reference_image_accordion_{prefix}': 'reference_image',
295
  f'pid_accordion_{prefix}': 'pid',
@@ -328,7 +334,7 @@ def attach_event_handlers(ui_components, demo):
328
  'conditioning_accordion_imagegen', 'reference_latent_accordion_imagegen',
329
  'hidream_o1_reference_accordion_imagegen', 'sensenova_reference_accordion_imagegen', 'joyai_reference_accordion_imagegen',
330
  'krea2_identity_edit_accordion_imagegen', 'krea2_reference_edit_accordion_imagegen',
331
- 'qwen_image_edit_accordion_imagegen', 'boogu_edit_accordion_imagegen',
332
  'reference_image_accordion_imagegen', 'pid_accordion_imagegen', 'vae_accordion_imagegen',
333
  ]
334
  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_qwen_image_2_1_edit_event_handlers,
22
  create_boogu_edit_event_handlers,
23
  create_reference_image_event_handlers
24
  )
 
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}')
 
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)
 
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, qwen_image_2_1_edit_acc=qwen_image_2_1_edit_accordion, boogu_edit_acc=boogu_edit_accordion, ref_img_acc=ref_img_accordion, sensenova_ref_acc=sensenova_ref_accordion,
143
  task_type=task_type, type_comp=type_comp
144
  )
145
  inputs = [arch_comp, cat_comp]
 
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)
 
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, qwen_image_2_1_edit_acc=qwen_image_2_1_edit_accordion, boogu_edit_acc=boogu_edit_accordion, ref_img_acc=ref_img_accordion, sensenova_ref_acc=sensenova_ref_accordion,
203
  task_type=task_type, type_comp=type_comp
204
  )
205
  if type_comp:
 
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)
 
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',
 
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', 'qwen_image_2_1_edit_accordion_imagegen', 'boogu_edit_accordion_imagegen',
338
  'reference_image_accordion_imagegen', 'pid_accordion_imagegen', 'vae_accordion_imagegen',
339
  ]
340
  for key in accordion_keys:
ui/events/run_handlers.py CHANGED
@@ -87,6 +87,7 @@ 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
  boogu_edit_data_components = ui_components.get(f'all_boogu_edit_components_flat_{prefix}', [])
91
  reference_image_data_components = ui_components.get(f'all_reference_image_components_flat_{prefix}', [])
92
 
@@ -99,7 +100,7 @@ def create_run_event(prefix: str, task_type: str = None, ui_components: dict = N
99
  all_chains = [
100
  lora_data_components, controlnet_data_components, anima_controlnet_lllite_data_components, diffsynth_controlnet_data_components, krea2_controlnet_data_components, ipadapter_data_components,
101
  sd3_ipadapter_data_components, flux1_ipadapter_data_components, style_data_components,
102
- 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, boogu_edit_data_components, reference_image_data_components
103
  ]
104
  for chain in all_chains:
105
  if chain:
@@ -134,6 +135,7 @@ def create_run_event(prefix: str, task_type: str = None, ui_components: dict = N
134
  assign_chain_data('krea2_identity_edit_data', krea2_identity_edit_data_components)
135
  assign_chain_data('krea2_reference_edit_data', krea2_reference_edit_data_components)
136
  assign_chain_data('qwen_image_edit_data', qwen_image_edit_data_components)
 
137
  assign_chain_data('boogu_edit_data', boogu_edit_data_components)
138
  assign_chain_data('reference_image_data', reference_image_data_components)
139
 
 
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
 
 
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, qwen_image_2_1_edit_data_components, boogu_edit_data_components, reference_image_data_components
104
  ]
105
  for chain in all_chains:
106
  if chain:
 
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
 
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, create_boogu_edit_ui,
12
  create_pid_ui
13
  )
14
 
@@ -189,6 +189,7 @@ 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_boogu_edit_ui(prefix))
193
  components.update(create_reference_image_ui(prefix))
194
  components.update(create_vae_override_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, create_qwen_image_2_1_edit_ui, create_boogu_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_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))
ui/shared/ui_components.py CHANGED
@@ -911,4 +911,33 @@ def create_boogu_edit_ui(prefix: str, max_units=10):
911
 
912
  components[key('all_boogu_edit_components_flat')] = ref_image_inputs
913
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
914
  return components
 
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
yaml/chain_features.yaml CHANGED
@@ -338,6 +338,21 @@ qwen_image_edit:
338
  required:
339
  - image
340
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  hidream_o1_smoothing:
342
  chains: hidream_o1_smoothing
343
  display_name: "HiDream O1 Smoothing Injector"
 
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
358
  display_name: "HiDream O1 Smoothing Injector"
yaml/constants.yaml CHANGED
@@ -103,6 +103,14 @@ RESOLUTION_MAP:
103
  "3:4 (Classic Portrait)": [896, 1152]
104
  "3:2 (Photography)": [1216, 832]
105
  "2:3 (Photography Portrait)": [832, 1216]
 
 
 
 
 
 
 
 
106
  qwen-image:
107
  "1:1 (Square)": [1328, 1328]
108
  "16:9 (Landscape)": [1664, 928]
@@ -285,6 +293,7 @@ MULTIPLIERS_MAP:
285
  flux2: 1
286
  ernie-image: 1
287
  z-image: 1
 
288
  qwen-image: 1
289
  longcat-image: 1
290
  cosmos-predict2: 1
 
103
  "3:4 (Classic Portrait)": [896, 1152]
104
  "3:2 (Photography)": [1216, 832]
105
  "2:3 (Photography Portrait)": [832, 1216]
106
+ qwen-image-2.1:
107
+ "1:1 (Square)": [1024, 1024]
108
+ "16:9 (Landscape)": [1344, 768]
109
+ "9:16 (Portrait)": [768, 1344]
110
+ "4:3 (Classic)": [1152, 896]
111
+ "3:4 (Classic Portrait)": [896, 1152]
112
+ "3:2 (Photography)": [1216, 832]
113
+ "2:3 (Photography Portrait)": [832, 1216]
114
  qwen-image:
115
  "1:1 (Square)": [1328, 1328]
116
  "16:9 (Landscape)": [1664, 928]
 
293
  flux2: 1
294
  ernie-image: 1
295
  z-image: 1
296
+ qwen-image-2.1: 1
297
  qwen-image: 1
298
  longcat-image: 1
299
  cosmos-predict2: 1
yaml/file_list.yaml CHANGED
@@ -637,6 +637,11 @@ file:
637
  source: "hf"
638
  repo_id: "Comfy-Org/z_image"
639
  repository_file_path: "split_files/diffusion_models/z_image_bf16.safetensors"
 
 
 
 
 
640
  # Qwen-Image
641
  - filename: "qwen_image_2512_fp8_e4m3fn_scaled_comfyui_4steps_v1.0.safetensors"
642
  source: "hf"
@@ -1001,6 +1006,10 @@ file:
1001
  source: "hf"
1002
  repo_id: "Comfy-Org/Omnigen2_ComfyUI_repackaged"
1003
  repository_file_path: "split_files/text_encoders/qwen_2.5_vl_fp16.safetensors"
 
 
 
 
1004
  vae:
1005
  - filename: "wan_2.1_vae.safetensors"
1006
  source: "hf"
@@ -1010,6 +1019,10 @@ file:
1010
  source: "hf"
1011
  repo_id: "Comfy-Org/Qwen-Image_ComfyUI"
1012
  repository_file_path: "split_files/vae/qwen_image_vae.safetensors"
 
 
 
 
1013
  - filename: "hunyuan_image_2.1_vae_fp16.safetensors"
1014
  source: "hf"
1015
  repo_id: "Comfy-Org/HunyuanImage_2.1_ComfyUI"
 
637
  source: "hf"
638
  repo_id: "Comfy-Org/z_image"
639
  repository_file_path: "split_files/diffusion_models/z_image_bf16.safetensors"
640
+ # Qwen-Image-2.1
641
+ - filename: "qwen_image_2.1_int8_convrot.safetensors"
642
+ source: "hf"
643
+ repo_id: "Comfy-Org/Qwen-Image-2.1"
644
+ repository_file_path: "diffusion_models/qwen_image_2.1_int8_convrot.safetensors"
645
  # Qwen-Image
646
  - filename: "qwen_image_2512_fp8_e4m3fn_scaled_comfyui_4steps_v1.0.safetensors"
647
  source: "hf"
 
1006
  source: "hf"
1007
  repo_id: "Comfy-Org/Omnigen2_ComfyUI_repackaged"
1008
  repository_file_path: "split_files/text_encoders/qwen_2.5_vl_fp16.safetensors"
1009
+ - filename: "qwen3vl_8b_w4a8.safetensors"
1010
+ source: "hf"
1011
+ repo_id: "Comfy-Org/Qwen-Image-2.1"
1012
+ repository_file_path: "text_encoders/qwen3vl_8b_w4a8.safetensors"
1013
  vae:
1014
  - filename: "wan_2.1_vae.safetensors"
1015
  source: "hf"
 
1019
  source: "hf"
1020
  repo_id: "Comfy-Org/Qwen-Image_ComfyUI"
1021
  repository_file_path: "split_files/vae/qwen_image_vae.safetensors"
1022
+ - filename: "qwen_image_2.1_vae_bf16.safetensors"
1023
+ source: "hf"
1024
+ repo_id: "Comfy-Org/Qwen-Image-2.1"
1025
+ repository_file_path: "vae/qwen_image_2.1_vae_bf16.safetensors"
1026
  - filename: "hunyuan_image_2.1_vae_fp16.safetensors"
1027
  source: "hf"
1028
  repo_id: "Comfy-Org/HunyuanImage_2.1_ComfyUI"
yaml/model_architecture_features.yaml CHANGED
@@ -70,6 +70,11 @@ z-image:
70
  - vae
71
  - pid
72
 
 
 
 
 
 
73
  qwen-image:
74
  enabled_chains:
75
  - lora
 
70
  - vae
71
  - pid
72
 
73
+ qwen-image-2.1:
74
+ enabled_chains:
75
+ - lora
76
+ - qwen_image_2_1_edit
77
+
78
  qwen-image:
79
  enabled_chains:
80
  - lora
yaml/model_architectures.yaml CHANGED
@@ -1,5 +1,6 @@
1
  architecture_order:
2
  - "Krea-2"
 
3
  - "SenseNova-U1.5"
4
  - "Mage-Flow"
5
  - "JoyAI-Image"
@@ -61,6 +62,9 @@ architectures:
61
  "Z-Image":
62
  model_type: "z-image"
63
  controlnet_key: "Z-Image"
 
 
 
64
  "Qwen-Image":
65
  model_type: "qwen-image"
66
  controlnet_key: "Qwen-Image"
 
1
  architecture_order:
2
  - "Krea-2"
3
+ - "Qwen-Image-2.1"
4
  - "SenseNova-U1.5"
5
  - "Mage-Flow"
6
  - "JoyAI-Image"
 
62
  "Z-Image":
63
  model_type: "z-image"
64
  controlnet_key: "Z-Image"
65
+ "Qwen-Image-2.1":
66
+ model_type: "qwen-image-2.1"
67
+ controlnet_key: "Qwen-Image"
68
  "Qwen-Image":
69
  model_type: "qwen-image"
70
  controlnet_key: "Qwen-Image"
yaml/model_defaults.yaml CHANGED
@@ -131,6 +131,13 @@ Z-Image:
131
  steps: 9
132
  cfg: 1.0
133
 
 
 
 
 
 
 
 
134
  Qwen-Image:
135
  _defaults:
136
  steps: 20
@@ -225,7 +232,7 @@ Anima:
225
  scheduler: "normal"
226
  positive_prompt: "masterpiece, best quality, score_9, score_8, score_7, year 2025, newest, highres, absurdres, very aesthetic, scenery, safe, "
227
  negative_prompt: "worst quality, low quality, early, old, score_1, score_2, score_3, cartoon, graphic, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured, long body, bad anatomy, bad hands, missing fingers, extra fingers, extra digits, fewer digits, cropped, very displeasing, artist name, blurry, jpeg artifacts, lowres, censor"
228
- "RAMTHRUST/RAMTHRUST'S-NSFW-PINK-ALCHEMY-ANIMA-v3.1":
229
  steps: 35
230
  cfg: 4.5
231
  sampler_name: "er_sde"
 
131
  steps: 9
132
  cfg: 1.0
133
 
134
+ Qwen-Image-2.1:
135
+ _defaults:
136
+ steps: 25
137
+ cfg: 1.0
138
+ sampler_name: "euler"
139
+ scheduler: "simple"
140
+
141
  Qwen-Image:
142
  _defaults:
143
  steps: 20
 
232
  scheduler: "normal"
233
  positive_prompt: "masterpiece, best quality, score_9, score_8, score_7, year 2025, newest, highres, absurdres, very aesthetic, scenery, safe, "
234
  negative_prompt: "worst quality, low quality, early, old, score_1, score_2, score_3, cartoon, graphic, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured, long body, bad anatomy, bad hands, missing fingers, extra fingers, extra digits, fewer digits, cropped, very displeasing, artist name, blurry, jpeg artifacts, lowres, censor"
235
+ "Crody/RAMTHRUST'S-NSFW-PINK-ALCHEMY-ANIMA-v3.1":
236
  steps: 35
237
  cfg: 4.5
238
  sampler_name: "er_sde"
yaml/model_list.yaml CHANGED
@@ -12,6 +12,14 @@ Checkpoint:
12
  unet: "krea2_raw-nvfp4.safetensors"
13
  clip: "qwen3vl_4b_fp8_scaled.safetensors"
14
  vae: "qwen_image_vae.safetensors"
 
 
 
 
 
 
 
 
15
  SenseNova-U1.5:
16
  latent_type: hidream_o1_latent
17
  models:
 
12
  unet: "krea2_raw-nvfp4.safetensors"
13
  clip: "qwen3vl_4b_fp8_scaled.safetensors"
14
  vae: "qwen_image_vae.safetensors"
15
+ Qwen-Image-2.1:
16
+ latent_type: latent
17
+ models:
18
+ - display_name: "Qwen-Image-2.1"
19
+ components:
20
+ unet: "qwen_image_2.1_int8_convrot.safetensors"
21
+ vae: "qwen_image_2.1_vae_bf16.safetensors"
22
+ clip: "qwen3vl_8b_w4a8.safetensors"
23
  SenseNova-U1.5:
24
  latent_type: hidream_o1_latent
25
  models:
yaml/task_features.yaml CHANGED
@@ -24,6 +24,7 @@ txt2img:
24
  - krea2_identity_edit
25
  - krea2_style_reference
26
  - qwen_image_edit
 
27
  - boogu_image_edit
28
  - reference_image
29
  - pid
@@ -50,6 +51,7 @@ img2img:
50
  - krea2_identity_edit
51
  - krea2_style_reference
52
  - qwen_image_edit
 
53
  - boogu_image_edit
54
  - reference_image
55
  - vae
@@ -75,6 +77,7 @@ inpaint:
75
  - krea2_identity_edit
76
  - krea2_style_reference
77
  - qwen_image_edit
 
78
  - boogu_image_edit
79
  - reference_image
80
  - vae
@@ -100,6 +103,7 @@ outpaint:
100
  - krea2_identity_edit
101
  - krea2_style_reference
102
  - qwen_image_edit
 
103
  - boogu_image_edit
104
  - reference_image
105
  - vae
@@ -125,6 +129,7 @@ hires_fix:
125
  - krea2_identity_edit
126
  - krea2_style_reference
127
  - qwen_image_edit
 
128
  - boogu_image_edit
129
  - reference_image
130
  - vae
 
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
 
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
 
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
 
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
 
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