diff --git a/README.md b/README.md index fc1b8f2..584a6df 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,29 @@ -3. **Restart** or **start** ComfyUI. -4. Look under **Nodes → sampling → custom** in ComfyUI’s UI. The **`SigmaGraphNode`** should appear. +# Sigma Graph Node for ComfyUI -## Usage +A compact, bidirectional editor for sigma schedules in diffusion sampling. -1. **Add** the Sigma Graph Node to your ComfyUI workflow. -2. **Connect** its output (`SIGMAS`) to a sampler that accepts custom sigmas (for example, a KSampler node set to external sigmas). -3. **Adjust** the `steps` parameter. -4. **Drag** points on the graph or **edit** the sigma values in the text box (comma-separated). -- Click the **▼** button to apply text changes to the graph. -- The node automatically recalculates your schedule after each drag or text edit. -5. **(Optional)** Use the presets to save and load different graph shapes. +- 📈 Drag points on a graph to shape the schedule +- ✍️ Edit sigma values in text form (auto-synced) +- 🔁 Click ▼ to apply text changes to the graph +- 💾 Save/load custom curve presets + +## Installation + +1. Copy this folder to: `ComfyUI/custom_nodes/sigma_graph` +2. Restart ComfyUI +3. Look for **SigmaGraphNode** under **sampling → custom** + +## How to Use + +1. Set your desired `steps` +2. Use the graph or text box to shape the sigma curve +3. Connect the output (`SIGMAS`) to a sampler that supports external schedules (e.g., KSampler) +4. (Optional) Use the 💾 button to toggle save mode and store/load your favorite curves ## File Overview -- **`__init__.py`** -Ties this folder into ComfyUI’s extension system. Sets the `WEB_DIRECTORY` to the `js` subfolder so ComfyUI can serve `SigmaGraphWidget.js`. - -- **`SigmaGraphNode.py`** -Defines the custom node class. Handles: -- Input parameters: `steps` (int) and `graph_data` (JSON string). -- Conversion of graph points into a PyTorch tensor of sigmas. -- The final reversed schedule (since many ComfyUI samplers read sigmas in that order). - -- **`SigmaGraphWidget.js`** -JavaScript front-end controlling the **interactive graph** and the **bidirectional** text input. It: -- Registers a custom DOM widget type (`"sigma_graph"`). -- Draws a canvas for the curve, with points you can drag, double-click, or remove by right-click. -- Syncs changes to the node’s internal JSON string value (`graph_data`). -- Updates a live text preview of the sigma schedule and can parse new sigma values from the text. - -## Contributing - -Feel free to open issues or pull requests if you have improvements or bug fixes! - ---- - -**Happy sampling!** Enjoy your interactive sigma graph editor. +| File | Purpose | +|--------------------------|------------------------------------------------------| +| `__init__.py` | Registers the node and loads the front-end widget | +| `SigmaGraphNode.py` | Backend logic: interpolates a sigma tensor schedule | +| `js/SigmaGraphWidget.js` | Custom graph widget UI (drag, sync, presets) |