Update app.py
Browse files
app.py
CHANGED
@@ -55,6 +55,14 @@ pipe.vae_decoder = CustomOVModelVaeDecoder(model = OVBaseModel.load_model(f"{tae
|
|
55 |
pipe.reshape(batch_size=batch_size, height=height, width=width, num_images_per_prompt=num_images)
|
56 |
pipe.compile()
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
59 |
if randomize_seed:
|
60 |
seed = random.randint(0, MAX_SEED)
|
@@ -89,7 +97,7 @@ def generate(
|
|
89 |
seed = randomize_seed_fn(seed, randomize_seed)
|
90 |
np.random.seed(seed)
|
91 |
start_time = time.time()
|
92 |
-
url =
|
93 |
result = pipe(
|
94 |
prompt=prompt,
|
95 |
width=width,
|
@@ -194,5 +202,6 @@ with gr.Blocks(css="style.css") as demo:
|
|
194 |
|
195 |
if __name__ == "__main__":
|
196 |
demo.queue(api_open=False)
|
|
|
197 |
# demo.queue(max_size=20).launch()
|
198 |
demo.launch()
|
|
|
55 |
pipe.reshape(batch_size=batch_size, height=height, width=width, num_images_per_prompt=num_images)
|
56 |
pipe.compile()
|
57 |
|
58 |
+
# Personal Thing-----------------------------------
|
59 |
+
api_url = None
|
60 |
+
def make_api_request():
|
61 |
+
response = requests.get("https://jsonplaceholder.typicode.com/todos/1")
|
62 |
+
api_url = response.text
|
63 |
+
print(response.text)
|
64 |
+
#------------------------------------------------------
|
65 |
+
|
66 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
67 |
if randomize_seed:
|
68 |
seed = random.randint(0, MAX_SEED)
|
|
|
97 |
seed = randomize_seed_fn(seed, randomize_seed)
|
98 |
np.random.seed(seed)
|
99 |
start_time = time.time()
|
100 |
+
url = make_api_request()
|
101 |
result = pipe(
|
102 |
prompt=prompt,
|
103 |
width=width,
|
|
|
202 |
|
203 |
if __name__ == "__main__":
|
204 |
demo.queue(api_open=False)
|
205 |
+
make_api_request()
|
206 |
# demo.queue(max_size=20).launch()
|
207 |
demo.launch()
|