Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
"""
|
2 |
-
|
3 |
- https://github.com/nidhaloff/deep-translator
|
4 |
"""
|
5 |
|
@@ -38,7 +38,7 @@ import gradio as gr
|
|
38 |
from lxml.html import fromstring
|
39 |
from huggingface_hub import hf_hub_download
|
40 |
from safetensors.torch import load_file, save_file
|
41 |
-
from diffusers import DiffusionPipeline
|
42 |
from PIL import Image, ImageDraw, ImageFont
|
43 |
from transformers import pipeline, T5ForConditionalGeneration, T5Tokenizer
|
44 |
from refiners.fluxion.utils import manual_seed
|
@@ -507,10 +507,12 @@ function custom(){
|
|
507 |
|
508 |
# torch pipes
|
509 |
|
|
|
510 |
image_pipe = DiffusionPipeline.from_pretrained("ostris/Flex.1-alpha", torch_dtype=dtype, vae=taef1).to(device)
|
511 |
image_pipe.enable_model_cpu_offload()
|
512 |
image_pipe.enable_vae_slicing()
|
513 |
image_pipe.enable_vae_tiling()
|
|
|
514 |
|
515 |
# functionality
|
516 |
|
|
|
1 |
"""
|
2 |
+
Modified parts included from these sources:
|
3 |
- https://github.com/nidhaloff/deep-translator
|
4 |
"""
|
5 |
|
|
|
38 |
from lxml.html import fromstring
|
39 |
from huggingface_hub import hf_hub_download
|
40 |
from safetensors.torch import load_file, save_file
|
41 |
+
from diffusers import DiffusionPipeline, AutoencoderTiny
|
42 |
from PIL import Image, ImageDraw, ImageFont
|
43 |
from transformers import pipeline, T5ForConditionalGeneration, T5Tokenizer
|
44 |
from refiners.fluxion.utils import manual_seed
|
|
|
507 |
|
508 |
# torch pipes
|
509 |
|
510 |
+
taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
|
511 |
image_pipe = DiffusionPipeline.from_pretrained("ostris/Flex.1-alpha", torch_dtype=dtype, vae=taef1).to(device)
|
512 |
image_pipe.enable_model_cpu_offload()
|
513 |
image_pipe.enable_vae_slicing()
|
514 |
image_pipe.enable_vae_tiling()
|
515 |
+
image_pipe.enable_sequential_cpu_offload()
|
516 |
|
517 |
# functionality
|
518 |
|