Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ trigger_word = "lineart,LineAniAF,"
|
|
14 |
# Hard set prompt template
|
15 |
hard_set_prompt = (
|
16 |
"minimalist black and white single-line art illustration of [subject], created in one continuous, unbroken stroke from start to finish. "
|
17 |
-
"The design uses true black and true white values only, with no gradients or gray tones. The artwork emphasizes clean, connected, and flowing lines,
|
18 |
"resulting in a sleek, modern aesthetic. The [subject] is depicted in a dynamic and recognizable pose, optimized for artistic purposes and ready for 3D printing applications."
|
19 |
)
|
20 |
|
@@ -23,15 +23,12 @@ constraints = (
|
|
23 |
"NEVER use anything besides a single black line of varying widths as necessary to achieve a result of the user's request."
|
24 |
)
|
25 |
|
26 |
-
|
27 |
def generate_image(prompt):
|
28 |
print("Generating image with prompt:", prompt)
|
29 |
api_url = f"https://api-inference.huggingface.co/models/{repo}"
|
30 |
-
token = os.getenv("
|
31 |
-
if not token:
|
32 |
-
raise ValueError("HF_TOKEN environment variable is not set.")
|
33 |
headers = {
|
34 |
-
"Authorization": f"Bearer {token}"
|
35 |
}
|
36 |
|
37 |
# Incorporate the hard set prompt and constraints
|
@@ -88,4 +85,4 @@ iface = gr.Interface(
|
|
88 |
)
|
89 |
|
90 |
print("Launching Gradio interface...")
|
91 |
-
iface.launch()
|
|
|
14 |
# Hard set prompt template
|
15 |
hard_set_prompt = (
|
16 |
"minimalist black and white single-line art illustration of [subject], created in one continuous, unbroken stroke from start to finish. "
|
17 |
+
"The design uses true black and true white values only, with no gradients or gray tones. The artwork emphasizes clean, connected, and flowing lines, "
|
18 |
"resulting in a sleek, modern aesthetic. The [subject] is depicted in a dynamic and recognizable pose, optimized for artistic purposes and ready for 3D printing applications."
|
19 |
)
|
20 |
|
|
|
23 |
"NEVER use anything besides a single black line of varying widths as necessary to achieve a result of the user's request."
|
24 |
)
|
25 |
|
|
|
26 |
def generate_image(prompt):
|
27 |
print("Generating image with prompt:", prompt)
|
28 |
api_url = f"https://api-inference.huggingface.co/models/{repo}"
|
29 |
+
# token = os.getenv("API_TOKEN") # Uncomment and use your Hugging Face API token
|
|
|
|
|
30 |
headers = {
|
31 |
+
# "Authorization": f"Bearer {token}"
|
32 |
}
|
33 |
|
34 |
# Incorporate the hard set prompt and constraints
|
|
|
85 |
)
|
86 |
|
87 |
print("Launching Gradio interface...")
|
88 |
+
iface.launch()
|