Update myapp.py
Browse files
myapp.py
CHANGED
|
@@ -13,6 +13,10 @@ CORS(myapp) # Enable CORS for all routes
|
|
| 13 |
HF_TOKEN = os.environ.get("HF_TOKEN") # Ensure to set your Hugging Face token in the environment
|
| 14 |
client = InferenceClient(token=HF_TOKEN)
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Function to generate an image from a prompt using the specified model
|
| 17 |
def generate_image(prompt, seed=1, model="prompthero/openjourney-v4"): # Default model if none provided
|
| 18 |
try:
|
|
|
|
| 13 |
HF_TOKEN = os.environ.get("HF_TOKEN") # Ensure to set your Hugging Face token in the environment
|
| 14 |
client = InferenceClient(token=HF_TOKEN)
|
| 15 |
|
| 16 |
+
@myapp.route('/')
|
| 17 |
+
def home():
|
| 18 |
+
return "Welcome to the Image Background Remover!"
|
| 19 |
+
|
| 20 |
# Function to generate an image from a prompt using the specified model
|
| 21 |
def generate_image(prompt, seed=1, model="prompthero/openjourney-v4"): # Default model if none provided
|
| 22 |
try:
|