gitwtfhub

wtf is cross-architecture-weight-grafting?

majidfida/cross-architecture-weight-grafting — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · researcherComplexity · 4/5Setup · hard

TL;DR

An experimental ComfyUI workflow that grafts a small percentage of one AI image model's weights into a different architecture model to blend visual qualities.

Mindmap

mindmap
  root((weight grafting))
    What it does
      Cross architecture merging
      Layer matching
      Partial weight blending
    Tech stack
      Python
      ComfyUI
    Use cases
      Blend model styles
      Reproduce experiments
      Build custom configs
    Audience
      AI researchers
      Image model tinkerers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Blend the visual style of one image generation model into a different one without a full model merge.

REASON 2

Reproduce the documented Krea into Qwen Image graft using the included ComfyUI workflow and configs.

REASON 3

Inspect a model's transformer layers to build a custom grafting configuration for a new model pair.

What's in the stack?

PythonComfyUI

How it stacks up

majidfida/cross-architecture-weight-grafting0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/52/54/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires downloading large donor and target model checkpoints separately and enough system RAM for the target model.

Wtf does this do

This project is an experimental technique for combining parts of two different AI image generation models even when they were built with different architectures. Normally, merging models only works if both share the same structure and layer sizes, so models like Qwen Image, Krea, FLUX and Klein cannot be merged with standard tools. The author calls this approach cross architecture weight grafting: instead of merging entire models, it inspects the layers of both models, matches up blocks that seem to do similar jobs, resizes tensors where needed, and blends in only a small percentage of one model's weights into another. The goal is not to replace either model, but to let one borrow some visual qualities from another while mostly keeping its own behavior. The best result documented so far grafts a small amount of Krea's weights into Qwen Image, keeping Qwen's strong composition and prompt understanding while picking up some of Krea's lighting and texture quality. The author found that keeping the blend ratio low, only a few percent per layer, works best, and that pushing it higher usually damages image quality instead of improving it. Other combinations, such as merging in the opposite direction or grafting between FLUX and other architectures, produced weaker or inconsistent results. The repository does not include any finished merged model files, since the original models carry different licenses that restrict sharing modified weights. Instead it provides the ComfyUI workflow, configuration files, and example images so others can reproduce the experiments themselves using models they download from the original sources. It runs on CPU only, and the amount of system memory needed depends mainly on the size of the target model rather than the donor model. This is explicitly framed as an ongoing research experiment rather than a finished, ready to use tool.

Yoink these prompts

Prompt 1
Walk me through installing the Advanced Model Inspector and merger nodes into my ComfyUI custom_nodes folder.
Prompt 2
Explain how to pick safe blend ratios per layer so I do not damage the target model's quality.
Prompt 3
Help me build a grafting config for merging a different pair of image models using this workflow.
Prompt 4
What does the Model Inspector output mean and how do I use it to write a merge config?

Frequently asked questions

wtf is cross-architecture-weight-grafting?

An experimental ComfyUI workflow that grafts a small percentage of one AI image model's weights into a different architecture model to blend visual qualities.

What language is cross-architecture-weight-grafting written in?

Mainly Python. The stack also includes Python, ComfyUI.

How hard is cross-architecture-weight-grafting to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cross-architecture-weight-grafting for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.