GPU hack fixes image res
Browse files
images.py
CHANGED
|
@@ -84,7 +84,7 @@ def _gen(prompt: str, image, seed: int) -> Image.Image:
|
|
| 84 |
return result.images[0]
|
| 85 |
|
| 86 |
|
| 87 |
-
@spaces.GPU(duration=
|
| 88 |
def initial_image(user_photo: Image.Image, art_style: str, scene_prompt: str, seed: int) -> Image.Image:
|
| 89 |
"""Generate the quest's initial scene with the user as the hero (photo as reference)."""
|
| 90 |
prompt = (
|
|
@@ -94,7 +94,7 @@ def initial_image(user_photo: Image.Image, art_style: str, scene_prompt: str, se
|
|
| 94 |
return _gen(prompt, image=[user_photo], seed=seed)
|
| 95 |
|
| 96 |
|
| 97 |
-
@spaces.GPU(duration=
|
| 98 |
def edit_image(base_image: Image.Image, edit_instruction: str, art_style: str, seed: int) -> Image.Image:
|
| 99 |
"""NEXT PASS (priority 5): edit the existing image into a success/failure state."""
|
| 100 |
prompt = f"{art_style}. {edit_instruction}"
|
|
|
|
| 84 |
return result.images[0]
|
| 85 |
|
| 86 |
|
| 87 |
+
@spaces.GPU(duration=30)
|
| 88 |
def initial_image(user_photo: Image.Image, art_style: str, scene_prompt: str, seed: int) -> Image.Image:
|
| 89 |
"""Generate the quest's initial scene with the user as the hero (photo as reference)."""
|
| 90 |
prompt = (
|
|
|
|
| 94 |
return _gen(prompt, image=[user_photo], seed=seed)
|
| 95 |
|
| 96 |
|
| 97 |
+
@spaces.GPU(duration=30)
|
| 98 |
def edit_image(base_image: Image.Image, edit_instruction: str, art_style: str, seed: int) -> Image.Image:
|
| 99 |
"""NEXT PASS (priority 5): edit the existing image into a success/failure state."""
|
| 100 |
prompt = f"{art_style}. {edit_instruction}"
|