ofxRunway how to correctly wait for a response

I forked and contributed an example to the repo for StyleGan2 image inference. I am realizing now that it is always one image behind the actual Runway image generator, in the sense that when I hit space bar, it sends a request to runway to return an image, and tries to render the result, but the result is not ready yet, and so it isn’t until I hit space bar again that an image is rendered, but it is the prior image from Runway.

#include "ofApp.h"

/*
    an example of GAN inference (generating an image from a GAN)
    this is setup for a network that wants an input vector z of 512 values
    and a truncation value, but should work with others if you modify it
    try using StyleGAN2 with RunwayML to generate some faces
    this example assumes Local GPU
*/

//--------------------------------------------------------------

void ofApp::setup()
{
    // uncomment the following line if you want a verbose log (which means a lot of info will be printed)
    // ofSetLogLevel(OF_LOG_VERBOSE);

    ofSetWindowShape(512, 512);

    // setup Runway
    runway.setup(this, "http://localhost:8000");
    runway.start();

    // infer a new image to begin
    generate_image(generate_random_z(), truncation);
}
//--------------------------------------------------------------
void ofApp::update()
{

    // infer/generate a new image if we have sent a request to Runway
    if (bWaitingForResponse)
    {
        runway.get("image", currentImg);    // stores generated image to currentImg
        bWaitingForResponse = false;
    }

}
//--------------------------------------------------------------
void ofApp::draw()
{

    // draw image received from Runway
    if (currentImg.isAllocated())
    {
        currentImg.draw(0, 0);
    }

    // draw Runway's status. It returns the bounding box of the drawn text. It is useful so you can draw other stuff and avoid overlays
    ofRectangle r = runway.drawStatus(620, 440, true);
    ofDrawBitmapString("Press ' ' to send to Runway", r.getBottomLeft() + glm::vec3(0, 20, 0));


    // save frame (useful for latent space walks)
    // string fn = ofToString(ofGetFrameNum(),4,'0')+".png";
    // cout << fn << endl;
    // ofSaveScreen(fn);
}

//--------------------------------------------------------------
void ofApp::keyReleased(int key)
{
    // on spacebar, infer a new image
    if (key == ' ')
    {
        generate_image(generate_random_z(), truncation);
    }
}

//--------------------------------------------------------------
vector<float> ofApp::generate_random_z()
{
    // this is a helpful method to generate a random set of input values

    vector<float> z; // create an empty vector of floats
    for (int i = 0; i < 512; i++)
    {
        z.push_back(ofRandom(-min_max_vals, min_max_vals));
    }

    return z;
}

//--------------------------------------------------------------
void ofApp::generate_image(vector<float> z, float truncation)
{
    // skip if content image isn't loaded yet

    if (runway.isBusy())
        return;

    // create a data object to send
    ofxRunwayData data;
    data.setFloats("z", z); // add our vector of random floats
    data.setFloat("truncation", truncation);    // also need to set a truncation

    // basically, the higher the truncation value the weirder the results

    runway.send(data);

    bWaitingForResponse = true;
}

// Runway sends information about the current model
//--------------------------------------------------------------
void ofApp::runwayInfoEvent(ofJson &info)
{
    ofLogNotice("ofApp::runwayInfoEvent") << info.dump(2);
}
// if anything goes wrong
//--------------------------------------------------------------
void ofApp::runwayErrorEvent(string &message)
{
    ofLogNotice("ofApp::runwayErrorEvent") << message;
}

I have tried adding a condition to see if Runway is still busy before rendering the latest returned image, but it doesn’t work, as perhaps Runway is not busy the moment I am checking, but the image is still in transit via HTTP. I see a couple of other methods in the repo for ofxRunway but I’m not quite sure how to proceed. I think what would be super useful is if Runway allowed you to add an ID# to any request and return it with images coming back so you could know which request is associated with any incoming image, but that’s a Runway thing and not an ofxRunway thing.

This is a pretty specific question & I am tired and perhaps nonsensical, but maybe someone can help. Thanks!