Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ from fastai.vision.all import *
|
|
| 5 |
from pathlib import Path
|
| 6 |
from PIL import Image
|
| 7 |
import io
|
| 8 |
-
from fal
|
| 9 |
|
| 10 |
# Dictionary of plant names and their Wikipedia links
|
| 11 |
search_terms_wikipedia = {
|
|
@@ -121,7 +121,7 @@ def process_image(img, generate_image=True):
|
|
| 121 |
prompt = random.choice(prompt_templates).format(flower=predicted_class)
|
| 122 |
|
| 123 |
# Use fal-client to generate image
|
| 124 |
-
result =
|
| 125 |
"fal-ai/flux/dev",
|
| 126 |
input={"prompt": prompt},
|
| 127 |
on_queue_update=on_queue_update
|
|
@@ -191,4 +191,4 @@ with gr.Blocks() as demo:
|
|
| 191 |
)
|
| 192 |
|
| 193 |
# Start the application
|
| 194 |
-
demo.launch(inline=False)
|
|
|
|
| 5 |
from pathlib import Path
|
| 6 |
from PIL import Image
|
| 7 |
import io
|
| 8 |
+
from fal import client as fal_client
|
| 9 |
|
| 10 |
# Dictionary of plant names and their Wikipedia links
|
| 11 |
search_terms_wikipedia = {
|
|
|
|
| 121 |
prompt = random.choice(prompt_templates).format(flower=predicted_class)
|
| 122 |
|
| 123 |
# Use fal-client to generate image
|
| 124 |
+
result = fal_client.subscribe(
|
| 125 |
"fal-ai/flux/dev",
|
| 126 |
input={"prompt": prompt},
|
| 127 |
on_queue_update=on_queue_update
|
|
|
|
| 191 |
)
|
| 192 |
|
| 193 |
# Start the application
|
| 194 |
+
demo.launch(inline=False)
|