Are you infringing Stability AI's copyright by clicking this link? If
not, are you infringing Stability AI's copyright by then writing a
Python script that uses this file to generate images, if you only run
it locally on your GPU?

Even if a court answers either question with "yes", it still does not
follow that you are bound by any other licensing terms Stability AI is
attaching to those files, a license which you never agreed to when
clicking the link.

I don't entirely follow, I'm afraid.

Say I take a document from the Internet and then use it to do something (anything). 

Copyright inherently exists in the document. 

I am very likely to have done something which is 'copying' in legal terms, either in the act of downloading it, or the act of using it, or both.

What is my legal basis for doing this? Given that there is copyright in the work and I have copied it, I must have a legal basis for doing this, I can't just wave my hands and say it's fine. 
In common law legal systems the answer is likely to be one (or more) of;
- there is a statutory basis for my doing so (perhaps the one I mentioned earlier in the thread or a 'fair dealing' exemption)
- there is an explicit licence attached to the document defined somewhere by the creator (either a general one or something created by a contract between myself and the creator)
- there is an implicit licence attached to the document defined by the creator's actions in the light of their reasonable expectations of others' actions, e.g. if you publish a document on the internet you very probably imply a licence to perform such copying as is actually needed to read the document

If I have clicked a button to indicate acceptance of some terms and conditions, then very likely those terms contains an explicit licence I can rely on.

However, not clicking a button to indicate acceptance of terms and conditions does not mean I can do whatever I want. It means that I either have to find other evidence of an explicit licence (maybe text on the document?), or consider whether there is an implicit licence or exemption. An implicit licence might well exist but is quite likely to be minimal in scope.

If I then re-copy the material and then republish it, that would be a further act of copying, and I would have to answer the same questions. The fact of republication does not fundamentally change anything, though it may be handled differently in the different exemptions or licences I am probably relying on.  An implicit licence is less likely to exist the further I manipulate something, as that is probably further removed from the copyright holder's original expectations. 

Chris