Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,6 +44,7 @@ def get_transform(resolution):
|
|
| 44 |
])
|
| 45 |
|
| 46 |
# Image-to-Text Function
|
|
|
|
| 47 |
def image_to_text(image, prompt, resolution=1024, steps=64, cfg=9.0):
|
| 48 |
try:
|
| 49 |
transform = get_transform(resolution)
|
|
@@ -73,6 +74,7 @@ def image_to_text(image, prompt, resolution=1024, steps=64, cfg=9.0):
|
|
| 73 |
return f"Error: {str(e)}"
|
| 74 |
|
| 75 |
# Text-to-Image Function
|
|
|
|
| 76 |
def text_to_image(prompt, negative_prompt, num_images=1, resolution=1024, steps=64, cfg=9.0):
|
| 77 |
try:
|
| 78 |
negative_prompt = negative_prompt or "worst quality, low quality, low res, blurry, distortion, watermark, logo, signature, text, jpeg artifacts, signature, sketch, duplicate, ugly, identifying mark"
|
|
|
|
| 44 |
])
|
| 45 |
|
| 46 |
# Image-to-Text Function
|
| 47 |
+
@spaces.GPU
|
| 48 |
def image_to_text(image, prompt, resolution=1024, steps=64, cfg=9.0):
|
| 49 |
try:
|
| 50 |
transform = get_transform(resolution)
|
|
|
|
| 74 |
return f"Error: {str(e)}"
|
| 75 |
|
| 76 |
# Text-to-Image Function
|
| 77 |
+
@spaces.GPU
|
| 78 |
def text_to_image(prompt, negative_prompt, num_images=1, resolution=1024, steps=64, cfg=9.0):
|
| 79 |
try:
|
| 80 |
negative_prompt = negative_prompt or "worst quality, low quality, low res, blurry, distortion, watermark, logo, signature, text, jpeg artifacts, signature, sketch, duplicate, ugly, identifying mark"
|