Skip to content

Patch support for extensions - #37

Merged
bigbrozer merged 1 commit into
bigbrozer:features/nextfrom
algonixdev:algox-extpatches
Aug 25, 2026
Merged

bigbrozer merged 1 commit into
bigbrozer:features/nextfrom
algonixdev:algox-extpatches

Conversation

@algonixdev

Copy link
Copy Markdown
Contributor

Some extensions occasionally need a small local fix that isn't merged upstream yet (a bug, a compatibility issue...). Until now the only option was to fork the extension. This PR adds a patch mechanism that's applied automatically on every install/update, without maintaining a fork.

Changes

  • entrypoint.sh: new patch_extension function, called from install_extension on every install/update (fresh clone or git reset --hard → upstream code is always "clean", so the patch must be reapplied every time). Applies all .patch files found in patches// in lexical order, idempotently (skips if already applied, via git apply --check --reverse), no-op if the patches// directory doesn't exist.
  • patches/README.md: documents the format and the patch-creation workflow (git diff > patches//001-description.patch).
  • patches/_example/: a fictitious example illustrating the convention (never applied — no extension is named _example).
  • patches/comfyui-ollama/001-fix-context-keyerror.patch: first real patch — fixes a KeyError on response['context'] by switching to response.get('context', []).
  • Dockerfile: copies the patches/ directory into the image.
  • AGENTS.md: new "Patching an extension" section documenting the convention for future contributions.

@bigbrozer
bigbrozer changed the base branch from main to features/next August 25, 2026 18:26
@bigbrozer

Copy link
Copy Markdown
Owner

It looks good for me and I like the idea. Will merge for next release. Thank you for this proposal <3

@bigbrozer
bigbrozer merged commit fbe4f46 into bigbrozer:features/next Aug 25, 2026
1 check failed
bigbrozer pushed a commit that referenced this pull request Aug 25, 2026
* Introduces a new feature that allows users to [apply patches to extensions](patches/README.md) in the ComfyUI project. The patch support enables users to modify and enhance the functionality of extensions without directly altering the original source code.
* Thanks @algonixdev for the patch support implementation.
@bigbrozer bigbrozer mentioned this pull request Aug 25, 2026
bigbrozer pushed a commit that referenced this pull request Aug 25, 2026
* Introduces a new feature that allows users to [apply patches to extensions](patches/README.md) in the ComfyUI project. The patch support enables users to modify and enhance the functionality of extensions without directly altering the original source code.
* Thanks @algonixdev for the patch support implementation.
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.

2 participants