Middle+
How is the step t sampled during training and inference in Stable Diffusion?
sobes.tech AI
Answer from AI
Promises are created for each expression on the right side of await. If the expression is already a promise, await waits for its completion. If the expression is not a promise, await will wrap it in a fulfilled promise.
Example with an asynchronous function:
async function example() {
const result1 = await someAsyncOperation1(); // A promise is created here if someAsyncOperation1() returns something else
const result2 = await someAsyncOperation2(); // A promise is created here
const result3 = await Promise.resolve(10); // The promise already exists, `await` waits for it
}
In this case, someAsyncOperation1() and someAsyncOperation2() can return promises or regular values. await always works with promises.