Spaces:
Runtime error
Runtime error
Commit
·
6bc28eb
1
Parent(s):
0013162
add space
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import sys
|
|
4 |
from typing import Sequence, Mapping, Any, Union
|
5 |
import torch
|
6 |
import gradio as gr
|
|
|
7 |
|
8 |
from huggingface_hub import hf_hub_download
|
9 |
from huggingface_hub import snapshot_download
|
@@ -266,12 +267,9 @@ saveimage = NODE_CLASS_MAPPINGS["SaveImage"]()
|
|
266 |
imageupscalewithmodel = NODE_CLASS_MAPPINGS["ImageUpscaleWithModel"]()
|
267 |
|
268 |
|
269 |
-
# def main():
|
270 |
-
def generate_image(model_image, hairstyle_template_image):
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
|
|
|
|
|
275 |
with torch.inference_mode():
|
276 |
cliptextencode_52 = cliptextencode.encode(
|
277 |
text="multiple_hands, multiple_legs, multiple_girls\nlow quality, blurry, out of focus, distorted, unrealistic, extra limbs, missing limbs, deformed hands, deformed fingers, extra fingers, long neck, unnatural face, bad anatomy, bad proportions, poorly drawn face, poorly drawn eyes, asymmetrical eyes, extra eyes, extra head, floating objects, watermark, text, logo, jpeg artifacts, overexposed, underexposed, harsh lighting, bad posture, strange angles, unnatural expressions, oversaturated colors, messy hair, unrealistic skin texture, wrinkles inappropriately placed, incorrect shading, pixelation, complex background, busy background, detailed background, crowded scene, clutter, messy elements, unnecessary objects, overlapping objects, intricate patterns, vibrant colors, high contrast, graffiti, shadows, reflections, multiple layers, unrealistic lighting, overexposed areas.",
|
|
|
4 |
from typing import Sequence, Mapping, Any, Union
|
5 |
import torch
|
6 |
import gradio as gr
|
7 |
+
import spaces
|
8 |
|
9 |
from huggingface_hub import hf_hub_download
|
10 |
from huggingface_hub import snapshot_download
|
|
|
267 |
imageupscalewithmodel = NODE_CLASS_MAPPINGS["ImageUpscaleWithModel"]()
|
268 |
|
269 |
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
+
@spaces.GPU(duration=60)
|
272 |
+
def generate_image(model_image, hairstyle_template_image):
|
273 |
with torch.inference_mode():
|
274 |
cliptextencode_52 = cliptextencode.encode(
|
275 |
text="multiple_hands, multiple_legs, multiple_girls\nlow quality, blurry, out of focus, distorted, unrealistic, extra limbs, missing limbs, deformed hands, deformed fingers, extra fingers, long neck, unnatural face, bad anatomy, bad proportions, poorly drawn face, poorly drawn eyes, asymmetrical eyes, extra eyes, extra head, floating objects, watermark, text, logo, jpeg artifacts, overexposed, underexposed, harsh lighting, bad posture, strange angles, unnatural expressions, oversaturated colors, messy hair, unrealistic skin texture, wrinkles inappropriately placed, incorrect shading, pixelation, complex background, busy background, detailed background, crowded scene, clutter, messy elements, unnecessary objects, overlapping objects, intricate patterns, vibrant colors, high contrast, graffiti, shadows, reflections, multiple layers, unrealistic lighting, overexposed areas.",
|