Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,9 +39,6 @@ def init_pool(_1,_2):
|
|
| 39 |
#pipe2 = StableDiffusionXLImg2ImgPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to(device)
|
| 40 |
#pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
| 41 |
|
| 42 |
-
pp1=pipe_t2i()
|
| 43 |
-
pp2=pipe_i2i()
|
| 44 |
-
|
| 45 |
def pipe_t2i():
|
| 46 |
global PIPE
|
| 47 |
if PIPE is None:
|
|
@@ -54,7 +51,10 @@ def pipe_i2i():
|
|
| 54 |
PIPE = pipeline("image-to-image", model="stabilityai/stable-diffusion-xl-refiner-1.0", tokenizer="stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, device=-1, variant="fp16", use_safetensors=True)
|
| 55 |
PIPE.unet = torch.compile(PIPE.unet, mode="reduce-overhead", fullgraph=True)
|
| 56 |
return PIPE
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
| 58 |
def translate(text,lang):
|
| 59 |
if text == None or lang == None:
|
| 60 |
return ""
|
|
|
|
| 39 |
#pipe2 = StableDiffusionXLImg2ImgPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to(device)
|
| 40 |
#pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
| 41 |
|
|
|
|
|
|
|
|
|
|
| 42 |
def pipe_t2i():
|
| 43 |
global PIPE
|
| 44 |
if PIPE is None:
|
|
|
|
| 51 |
PIPE = pipeline("image-to-image", model="stabilityai/stable-diffusion-xl-refiner-1.0", tokenizer="stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, device=-1, variant="fp16", use_safetensors=True)
|
| 52 |
PIPE.unet = torch.compile(PIPE.unet, mode="reduce-overhead", fullgraph=True)
|
| 53 |
return PIPE
|
| 54 |
+
|
| 55 |
+
pp1=pipe_t2i()
|
| 56 |
+
pp2=pipe_i2i()
|
| 57 |
+
|
| 58 |
def translate(text,lang):
|
| 59 |
if text == None or lang == None:
|
| 60 |
return ""
|