Spaces:
Running
Running
Update image.py
Browse files
image.py
CHANGED
@@ -6,8 +6,8 @@ import time
|
|
6 |
from PIL import Image
|
7 |
from g4f.client import Client
|
8 |
from g4f.Provider import RetryProvider, PollinationsAI, ImageLabs, Blackbox, HuggingSpace, Airforce
|
9 |
-
from g4f.Provider.hf_space.
|
10 |
-
from g4f.Provider.hf_space.
|
11 |
|
12 |
NEGATIVE_PROMPT = (
|
13 |
"low quality, blurry, pixelated, bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, "
|
@@ -45,7 +45,7 @@ def generate_image(title, category, summary):
|
|
45 |
prompt = f"Generate accurate image representing the {category} concept: ```{title.strip()}: {summary.strip()}```"
|
46 |
client = Client()
|
47 |
attempts = [
|
48 |
-
([
|
49 |
([HuggingSpace, PollinationsAI], "flux-dev"),
|
50 |
([PollinationsAI], "flux-pro"),
|
51 |
([Airforce, PollinationsAI, Blackbox], "flux"),
|
@@ -117,4 +117,4 @@ if __name__ == "__main__":
|
|
117 |
"It details the calculation of these invariants using moduli spaces of stable maps and explores their implications in enumerative geometry."
|
118 |
)
|
119 |
image_url = fetch_image(title, category, summary)
|
120 |
-
print(image_url)
|
|
|
6 |
from PIL import Image
|
7 |
from g4f.client import Client
|
8 |
from g4f.Provider import RetryProvider, PollinationsAI, ImageLabs, Blackbox, HuggingSpace, Airforce
|
9 |
+
from g4f.Provider.hf_space.BlackForestLabs_Flux1Schnell import BlackForestLabs_Flux1Schnell
|
10 |
+
from g4f.Provider.hf_space.Voodoohop_Flux1Schnell import Voodoohop_Flux1Schnell
|
11 |
|
12 |
NEGATIVE_PROMPT = (
|
13 |
"low quality, blurry, pixelated, bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, "
|
|
|
45 |
prompt = f"Generate accurate image representing the {category} concept: ```{title.strip()}: {summary.strip()}```"
|
46 |
client = Client()
|
47 |
attempts = [
|
48 |
+
([BlackForestLabs_Flux1Schnell, Voodoohop_Flux1Schnell, HuggingSpace], "flux-schnell"),
|
49 |
([HuggingSpace, PollinationsAI], "flux-dev"),
|
50 |
([PollinationsAI], "flux-pro"),
|
51 |
([Airforce, PollinationsAI, Blackbox], "flux"),
|
|
|
117 |
"It details the calculation of these invariants using moduli spaces of stable maps and explores their implications in enumerative geometry."
|
118 |
)
|
119 |
image_url = fetch_image(title, category, summary)
|
120 |
+
print(image_url)
|