Commit Graph
55 Commits
Author SHA1 Message Date
Reithan 07f5ea0dbe Add version increment check to publish workflow (#33)
## Summary
- Add version increment check before publishing to Comfy registry
- Compare current version in pyproject.toml against HEAD~1
- Skip publishing successfully if version is unchanged (prevents
unnecessary publish attempts)
- Fail workflow if version is downgraded (prevents registry conflicts)
- Use Python with semantic versioning for robust comparison (handles
0.7.10 > 0.7.9 correctly)

## Changes
- Modified `.github/workflows/publish.yml`:
  - Added `fetch-depth: 2` to checkout step to access HEAD~1
  - Added new version check step with Python script
  - Made publish step conditional on version increment

## Test Plan
- [x] All pre-commit hooks pass
- [x] All tests pass
- [ ] Test unchanged version: Modify pyproject.toml metadata (not
version), workflow should skip publish
- [ ] Test version increment: Bump version, workflow should publish
- [ ] Test version downgrade: Downgrade version, workflow should fail
- [ ] Test invalid version: Malformed version, workflow should fail

The workflow can be tested using manual `workflow_dispatch` trigger
after merge.
2026-05-15 18:05:58 -07:00
Reithan ee6dc40393 Add git hooks and development infrastructure (#32)
## Summary

Establishes a complete development infrastructure for the project with
automated quality checks, testing, and contributor guidelines.

- Add pre-commit hooks for automated linting and quality checks
- Configure ruff for code linting and formatting (120 char line length,
Python 3.10+)
- Set up pytest with mocked torch/gradio dependencies for CI/CD
compatibility
- Create comprehensive CONTRIBUTING.md with setup instructions and
workflow guidance
- Add uv.lock for reproducible dependency resolution
- Replace trivial tests with functional interface tests

## Key Components

### Git Hooks (.pre-commit-config.yaml)
- Pre-commit: ruff linting/formatting, trailing whitespace, YAML
validation, prevents direct commits to main
- Pre-push: runs pytest test suite, prevents direct pushes to main

### Testing (tests/)
- Functional tests for ComfyUI node and WebUI script interfaces
- Mock torch, gradio, and WebUI modules via conftest.py (no heavy
dependencies in dev env)
- Tests verify API contracts without requiring full ComfyUI/WebUI
runtime

### Documentation (CONTRIBUTING.md)
- Development setup with uv package manager
- Git workflow and branch protection guidelines
- Linting, testing, and pre-commit hook usage
- Code style guidelines and commit message conventions

## Test Plan

- [x] Pre-commit hooks run on commit (linting, formatting, checks)
- [x] Pre-push hooks run pytest successfully
- [x] All tests pass in isolated venv
- [x] CONTRIBUTING.md instructions verified
- [x] No IDE diagnostics or issues
2026-05-15 16:08:45 -07:00
Reithan cd1f2e76f4 Fix Node.js 20 deprecation warnings in GitHub Actions
- Update actions/checkout from @v4 to @v5 for Node.js 24 support
- Update Comfy-Org/publish-node-action from @v1 to @main per official docs
- Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true environment variable
2026-05-15 14:17:02 -07:00
Reithan a70d1d09bb Fix prediction type detection for WAN/RES4LYF samplers (#30)
## Summary

Fixes issue #20 where NRS would fail with `RuntimeError: "Could not
determine prediction type for this model"` when using certain samplers
like WanKSamplerAdvanced and RES4LYF ClownsharKsampler.

## Changes Made

- **Enhanced prediction type mapping**: Added support for FLOW models
(`"flow"`, `"wan"`, `"const"` → `PredictionType.EPS`)
- **Improved model introspection**: Added `model_sampling` class
inspection and `model.model.model_type` enum detection
- **Graceful fallback**: Replaced RuntimeErrors with safe EPS defaults
when prediction type cannot be determined
- **Better debugging**: Added warning logs when using fallback
prediction types
- **Documentation**: Updated README with sampler compatibility
information
- **Version bump**: 0.7.3 → 0.7.4

## Technical Details

The issue occurred because WAN and similar samplers use **FLOW model
types** (ModelType.FLOW) that implement the CONST prediction class,
which are fundamentally different from traditional EPS/V-prediction
models. The original code only checked for string attributes and failed
to recognize these newer model architectures.

This fix follows the established pattern from commits fc38b5c (flux
support) and ba145c4 (chroma support) while adding robust fallback
mechanisms.

## Testing

- ✅ Manual integration testing planned with WanKSamplerAdvanced
- ✅ Manual integration testing planned with RES4LYF ClownsharKsampler  
- ✅ Backwards compatibility maintained for existing samplers
- ✅ Enhanced logging for debugging unrecognized models

## Risk Assessment

**Low Risk**: Only enhances existing detection logic without changing
core mathematical operations. Adds fallback instead of removing
functionality.

Closes #20

---------

Signed-off-by: Reithan <bo122081@hotmail.com>
v0.7.4-b
2026-05-15 13:57:06 -07:00
Reithan b034c3f09f Improve setup documentation and ComfyUI UX (#29)
## Summary
Addresses documentation gaps identified in issue #25 by improving setup
instructions and user experience across all supported platforms.

## Changes Made

### 📚 README Enhancements
- **ComfyUI Setup Section**: Added collapsible setup instructions with:
  - Clear workflow explanation (Model → NRS Node → KSampler)
  - Prominent note that CFG setting on KSampler is ignored
  - Pro tip for validating NRS is working
  - Reference to the workflow image from issue #25

- **A1111/Forge/reForge Setup Section**: Added setup instructions
explaining:
  - Extension installation and enabling process
  - CFG Scale is ignored when NRS is active
  - Reference to Beginner How-To for parameter guidance

- **StabilityMatrix Integration**: Added section highlighting native
support with link to https://lykos.ai/

### 🖥️ ComfyUI Node UX Improvements
- **Node Description**: Added clear explanation that NRS replaces CFG
and KSampler CFG will be ignored
- **Parameter Tooltips**: Added helpful guidance directly in the
interface:
  - **Skew**: Explains direction steering, suggests starting with CFG/2
- **Stretch**: Explains positive intensification, suggests normal CFG
value
- **Squash**: Explains effect softening, recommends keeping low
initially

## Problem Solved
This addresses the confusion reported in issue #25 where users struggled
with:
- How to configure CFG values in ComfyUI workflows
- Understanding the relationship between NRS and CFG
- Lack of example workflows and clear setup guidance

## Test Plan
- [x] Verify README renders correctly with collapsible sections
- [ ] Test ComfyUI node shows tooltips when hovering over parameters
- [ ] Confirm node description appears in ComfyUI interface
- [x] Validate links work correctly (StabilityMatrix)

Fixes #25
2026-05-15 11:59:20 -07:00
Reithan 2583c237f2 Bump version from 0.7.2 to 0.7.3
Signed-off-by: Reithan <bo122081@hotmail.com>
v0.7.4
2026-02-13 17:41:23 -08:00
Reithan c83958c457 Update default parameter values for NRS node and script (#26)
Updates the default parameter values for the Negative Rejection Steering
implementation to improve usability and user experience.

## Changes
- **Skew**: 4.0 → 2.00
- **Stretch**: 2.0 → 5.00  
- **Squash**: 0.0 → 0.75

These new defaults (2/5/0.75) provide a better starting point for users,
as documented in the updated README.

## Files Modified
- `NRS/nodes_NRS.py`: Updated default values in INPUT_TYPES
- `scripts/negative_rejection_steering_script.py`: Updated default
initialization values
- `README.md`: Updated beginner how-to guide to reference the new
defaults

---------

Signed-off-by: Reithan <bo122081@hotmail.com>
2026-02-13 17:36:43 -08:00
Reithan a0b2d99bc7 Bump version from 0.7.1 to 0.7.2 2025-12-04 20:44:46 -08:00
Reithan ba145c4722 Add 'chroma' to _RAW_TO_ENUM mapping (#23)
Ad support for chroma as EPS.
v0.7.2
2025-12-04 18:29:03 -08:00
Reithan c21dbfe1e5 Update README.md (#21) 2025-09-11 20:27:24 -07:00
Alexander Brown fc38b5c998 Add flux to the Prediction Type inference (#18)
Testing it in Comfy, it seems like it works as `EPS`, though it also
worked with `V`.
2025-07-31 23:23:09 -07:00
Reithan d26fcf6fc8 Update pyproject.toml 2025-07-26 04:44:24 -07:00
Reithan 3d8827f132 Cleanup old math versions and fix variables (#16) v0.7.1 2025-07-26 04:34:34 -07:00
Reithan 62bef2e275 Update README.md 2025-07-21 04:01:10 -07:00
Reithan fecdfe01df Update README.md 2025-07-21 04:00:01 -07:00
Reithan c5610837e4 Update README.md 2025-07-21 03:59:41 -07:00
Reithan 21ac7cf0cb Update pyproject.toml (#14) 2025-07-21 03:56:18 -07:00
Reithan 4930d862d5 Update publish.yml 2025-07-21 03:50:11 -07:00
e8b727f914 Add pyproject.toml for Custom Node Registry (#7)
Hey! My name is Robin and I'm from [comfy-org](https://comfy.org/)! We
would love to have you join the Comfy Registry, a public collection of
custom nodes which lets authors publish nodes by version and automate
testing against existing workflows.

The registry is already integrated with ComfyUI-Manager, and we want it
to be the default place users install nodes from eventually. We do a
security-scan of every node to improve safety. Feel free to read up more
on the registry
[here](https://docs.comfy.org/registry/overview#introduction)

Action Required:

- [ ] Go to the [registry](https://registry.comfy.org). Login and create
a publisher id (everything after the `@` sign on your registry profile).
- [ ] Add the publisher id into the pyproject.toml file.
- [ ] Merge the separate Github Actions PR, then merge this PR.

If you want to publish the node manually, [install the
cli](https://docs.comfy.org/comfy-cli/getting-started#install-cli) by
running `pip install comfy-cli`, then run `comfy node publish`

Otherwise, if you have any questions, please message me on discord at
robinken or join our [server](https://discord.com/invite/comfyorg)!

---------

Co-authored-by: snomiao <snomiao+comfy-pr@gmail.com>
Co-authored-by: Reithan <bo122081@hotmail.com>
2025-07-21 03:46:38 -07:00
Reithan 389aedfd17 upload icon 2025-07-21 03:43:44 -07:00
99824b2ee5 Add Github Action for Publishing to Comfy Registry (#6)
This PR adds a Github Action (publish-node-action) that will publish an
updated version of your custom node to the
[registry](https://registry.comfy.org/) whenever the `pyproject.toml`
file changes. The pyproject.toml defines the custom node version you
want to publish (added in another PR). Make sure you update the version
number in `pyproject.toml` when you make a change that should be
published to everyone!

Action Required:

- [ ] Make sure the trigger branch (`master` or `main`) in
`publish.yaml` matches the branch you want to use as the publishing
branch. It will only trigger when the pyproject.toml gets updated on
that branch.
- [ ] Create an api key on the Registry for publishing from Github.
[Instructions](https://docs.comfy.org/registry/publishing#create-an-api-key-for-publishing).
- [ ] Add it to your Github Repository Secrets as
`REGISTRY_ACCESS_TOKEN`.

Please message me on Discord at robinken or join our
[server](https://discord.com/invite/comfyorg) server if you have any
questions!

---------

Co-authored-by: snomiao <snomiao+comfy-pr@gmail.com>
Co-authored-by: Reithan <bo122081@hotmail.com>
2025-07-21 01:50:39 -07:00
Reithan 4bb226aabb Update README.md (#13) 2025-07-21 01:18:32 -07:00
Reithan 60b5127cf4 Update to Math v0.6.0 (#12)
- [X] add math 0.6
- [X] update readme
- [X] add example images
- [X] upload permanent copy of graph image
v0.7.0
2025-07-21 01:14:06 -07:00
Reithan e72afd4189 update note 2025-07-20 07:20:35 -07:00
Reithan 98a9b6d656 minor optimizations 2025-07-20 07:13:07 -07:00
Reithan e0988d3b24 Fix detection of model type (#11)
- fix some scaling issues
v0.6.2
2025-07-20 04:04:54 -07:00
Reithan 932c7b2136 fix batch size error when applying scale as broadcast v0.6.1 2025-07-19 20:24:28 -07:00
Reithan 50ddd2ac47 Update math to 0.5.0 (#10)
- [X] detects v-pred/eps and uses appropriate pre/post scaling
- [X] supports detection in Forge, Comfy and various loaders/models
v0.6.0
2025-07-19 17:59:27 -07:00
Reithan 3768f4a768 Update ComfyUI compatibility (#5) v0.5.2 2025-04-13 22:13:50 -07:00
Reithan e82622cefe Update negative_rejection_steering_script.py 2025-03-29 05:13:16 -07:00
Reithan 793914ced3 Update README.md (#4)
Correctd steps
2025-03-28 15:52:13 -07:00
Reithan 46540aa7bc Update README.md
Add example images
v0.5.1
2025-03-24 00:58:59 -07:00
Reithan 873034b095 add init file for ComfyUI 2025-03-24 00:53:57 -07:00
Reithan 7d399643dd remove unneeded import 2025-03-24 00:53:44 -07:00
Reithan 50033c2622 add user examples 2025-03-24 00:52:15 -07:00
Reithan 36eb9d592b Update README.md
fix typo
2025-03-22 19:02:55 -07:00
Reithan bc50983954 Update README.md
tl;dr added
2025-03-22 19:01:27 -07:00
Reithan 0c37c6b124 Update README.md
Hide math stuff to help overwhelm
2025-03-22 18:56:38 -07:00
Reithan 8d7d9281f7 Update README.md
update tip verbiage
2025-03-22 18:51:30 -07:00
Reithan e55881afe2 Update README.md
"it's" to "its"
2025-03-22 18:40:25 -07:00
Reithan 0e8e508213 Update README.md
Turn params to bullet points
2025-03-22 18:36:09 -07:00
Reithan ff69ac386d Update README.md
Move image
2025-03-22 18:32:58 -07:00
Reithan 5be3c4c4f1 Update README.md
Update wording and instructions for clarity.
2025-03-22 18:31:19 -07:00
Reithan 81b836d2f1 Update README.md
Add Interactive Graph to Readme
2025-03-22 18:18:59 -07:00
Reithan a57c16a624 Update README.md 2025-03-22 05:06:20 -07:00
Reithan e6cdf03189 Update module UI style (#2)
Update module UI style
v0.4.7
2025-03-22 01:47:42 -07:00
Reithan 47e4b5073b Update README.md
wording
2025-03-21 22:24:43 -07:00
Reithan 0778fa4b03 Update README.md
Update CFG comparison
2025-03-21 22:08:25 -07:00
Reithan 4c8a086f6b fix missing input v0.4.6 2025-03-21 20:31:17 -07:00
Reithan 08493f81e5 Merge pull request #1 from Reithan/mvp-alpha
[MVP] Alpha Release
0.4.5
2025-03-21 20:17:13 -07:00