I hope I'm understanding the question correctly, apologies if not...
If you add a description to a node in a network diagram, then the id is no longer shown, so you can have:
@startuml
nwdiag {
network dmz {
address = "210.x.x.x/24"
web01 [address = "210.x.x.1", description = "web"];
web02 [address = "210.x.x.2", description = "web"];
}
}
@enduml

Therefore you could write a procedure to automate allocating the id:
@startuml
!$index=1
!unquoted procedure $node($name, $address)
%string($name+$index) [$args, address=$address, description=$name\n(id=%string($name+$index))];
!$index = $index + 1
!endprocedure
nwdiag {
network dmz {
address = "210.x.x.x/24"
$node(web, 210.x.x.1)
$node(web, 210.x.x.2)
$node(web, 210.x.x.3)
}
}
@enduml

For sequence diagrams, I'm not sure what you're calling a 'node'. If you mean participant, then you can use this syntax to have multiple participants with the same descriptions but different ids.
@startuml
Participant "Alice" as Alice1
Participant "Alice" as Alice2
Alice1 -> Alice2: hello
@enduml
