Nodes/EternalKernel PyTorch Nodes/SequentialModelProvider
ComfyUI Node

SequentialModelProvider

The empty canvas every network in this pack starts on

By TashaSkyUp·Created about a year ago·Updated about a year ago· 1
SequentialModelProvider
    • TORCH_MODEL
    namesequential_model

    This is the seed node of the whole pack. SequentialModelProvider hands you an empty nn.Sequential() - a PyTorch model with no layers in it - and every other model node (AddLinearLayerNode, AddConvLayer, AddBatchNormLayer, and the rest) takes that model, appends a layer, and returns the same model back. Chain them together and you've built a real neural network without writing a line of Python. It's not a lie that this is the first node you'll place in any ETK training graph; the name just makes it sound fancier than it is.

    It's part of EternalKernel PyTorch Nodes (TashaSkyUp), the raw-PyTorch-in-ComfyUI pack. Everything the pack does - train, infer, save - hangs off a TORCH_MODEL, and this is where those models come from.

    How it works

    The mechanism is two lines of source: it constructs nn.Sequential() and returns it. That's it. The name input doesn't get attached to anything meaningful - it's a label for you, not a model name - so you can leave it at sequential_model and never think about it again.

    The interesting part is how layers pile on. The layer nodes don't create new models; they mutate the one you gave them (model.insert(len(model), layer) and return the same object). In graph terms you wire model → model → model in a straight line, and each step appends one more layer. This works because execution order follows the chain, but it means the model is a single shared object being progressively built - don't branch the chain in confusing ways, because every downstream node is looking at the same growing list.

    A note on shape bookkeeping, since it decides whether your network actually runs: a Linear layer needs in_features that match the flattened input, and each layer's out_features becomes the next layer's in_features. Get one mismatch and you only find out at train or inference time, not when you're placing nodes.

    Inputs and outputs

    • name (required STRING) - cosmetic, default sequential_model.
    • Output: TORCH_MODEL - an empty nn.Sequential(), ready for layer nodes.

    Installing it

    Shared with the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TashaSkyUp/EternalKernelPytorchNodes.git
    cd EternalKernelPytorchNodes
    pip install -r requirements.txt
    

    Restart ComfyUI and it's under ETK/pytorch - or ComfyUI Manager, searching "EternalKernel PyTorch Nodes".

    Troubleshooting

    Two things surprise people. First, the output is genuinely empty: wire SequentialModelProvider straight into TrainModel and training will run a network with zero parameters - it technically executes and does nothing useful. Add layers. Second, because the layer nodes mutate in place, ComfyUI's "is this model up to date?" caching can get confused across re-runs; if your model suddenly looks stale after editing a layer upstream, bypass and re-enable the chain to force a refresh. And as always with this pack, the global validate_inputs patch means a wrong model type often fails deep in some other node rather than at this port - when the error is baffling, walk the chain back to the source.

    CategoryETK/pytorch

    Inputs (1)

    NameTypeDefaultDescription
    nameSTRINGsequential_model

    Outputs (1)

    NameTypeDescription
    TORCH_MODELTORCH_MODEL