Skip to content

LongCat-Image edit#13003

Merged
comfyanonymous merged 4 commits intoComfy-Org:masterfrom
Talmaj:LongCat-Image-edit
Mar 22, 2026
Merged

LongCat-Image edit#13003
comfyanonymous merged 4 commits intoComfy-Org:masterfrom
Talmaj:LongCat-Image-edit

Conversation

@Talmaj
Copy link
Contributor

@Talmaj Talmaj commented Mar 16, 2026

Repackaged model: https://huggingface.co/TalmajM/LongCat-Image-Edit_ComfyUI_repackaged/tree/main
Workflow: longcat_image_edit final.json

The outputs differ slightly from the original, because we pre-process the input image using existing comfy nodes.

@Talmaj Talmaj changed the title Long cat image edit LongCat-Image edit Mar 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4dc4ffb4-6113-451d-b95f-d95adaeb37f7

📥 Commits

Reviewing files that changed from the base of the PR and between 7a16e8a and 7174b95.

📒 Files selected for processing (5)
  • comfy/ldm/flux/model.py
  • comfy/model_base.py
  • comfy/text_encoders/llama.py
  • comfy/text_encoders/longcat_image.py
  • comfy/text_encoders/qwen_vl.py

📝 Walkthrough

Walkthrough

The PR modifies five files across text encoding and model architecture components. Changes include: propagating transformer_options through the image patch processing pipeline in the Flux model; adjusting rope-shift configuration to derive from cross-attention context length instead of fixed values; modifying position ID calculations in Qwen text encoding to account for attention masks; extending the LongCat image tokenizer with image padding constants and updating its tokenization method to handle image parameters; and adding a reordering step in Qwen VL's forward pass to restore windowed sequence ordering.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'LongCat-Image edit' is vague and does not clearly describe the specific changes made across multiple files (flux model, rope options, position handling, tokenizer updates). Consider a more descriptive title that captures the main technical changes, such as 'Add LongCat-Image edit support with position handling and tokenizer updates' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description provides context about the repackaged model and workflow file, which relates to the changeset's purpose of enabling LongCat-Image edit functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

hidden_states = block(hidden_states, position_embeddings, cu_seqlens_now, optimized_attention=optimized_attention)

hidden_states = self.merger(hidden_states)
# Potentially important for spatially precise edits. This is present in the HF implementation.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output still appears nice without having this change. However, the numerical precision (cosine distance) between the original implementation and this one jumps by a significant amount when adding this part.

@yu234567
Copy link

Does it support turbo?LongCat-Image-Edit-Turbo

@Talmaj
Copy link
Contributor Author

Talmaj commented Mar 18, 2026

Does it support turbo?LongCat-Image-Edit-Turbo

I haven't tested it, but it should work since it's using the same workflow/pipeline. I've repackaged the turbo model here:
https://huggingface.co/TalmajM/LongCat-Image-Edit-Turbo_ComfyUI_repackaged

Modify the provided workflow to use this model instead.

@comfyanonymous comfyanonymous merged commit d49420b into Comfy-Org:master Mar 22, 2026
14 checks passed
@zwukong
Copy link

zwukong commented Mar 22, 2026

Thanks , how it the fp8 quality, fp8 smaller and faster normally

@slmonker
Copy link

Is it still a single image edit model?

@Amazon90
Copy link

Has anyone tried Longcat image edit turbo? Compared to the non‑turbo version, which one is actually worth keeping?

@slmonker
Copy link

Has anyone tried Longcat image edit turbo? Compared to the non‑turbo version, which one is actually worth keeping?

Minor difference, about four times faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants