My question is essentially the same as this question, but I'm asking again because the answer provided is not very resilient. In particular, it doesn't work for the kind of diagram I want.
I want to use Tikz to draw a diagram with lots of nodes and arrows; essentially, a flowchart. The diagram should start with a single node which is centered on the page (in the MWE below, this is the "Hello there" box). If I try to just use the \centering command, the whole picture gets centered, which is not what I want.
The answer I linked above suggests using the \useasboundingbox command. However, this doesn't seem to do what I want. Here is my minimal working example:
\documentclass[a4paper, 11pt]{article}
\usepackage{tikz}
\begin{document}
This is a line of text which has been written with no purpose
other than to help illustrate how the figure below appears on a page.
\begin{figure}[ht]
\centering
\begin{tikzpicture}[rect/.style={rectangle, draw=black, thin}]
\node[rect] (box1) at (0,0) {Hello there};
% Location 1
\node[rect] (box2) at (5,-1) {Hi};
% Location 2
\end{tikzpicture}
\end{figure}
This is a line of text which has been written with no purpose
other than to help illustrate how the figure above appears on a page.
\end{document}
The linked answer suggests using the command \useasboundingbox (box1.south east) rectangle (box1.north west);. If I put this command at location 2, then the bounding box includes both boxes "Hello there" and "Hi", and the box "Hello there" is not centered (see below).

If I put this command at location 1, then the bounding box only includes the "Hello there" box; this centers it the way I want, but then the box "Hi" ends up overlapping with the text below (see below).

How can I make the "Hello there" box be centered on the page?


\useasboundingbox (box1.south east) rectangle (box1.west |- box2.south);