Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,10 @@ from diffusers import DiffusionPipeline, UNet2DConditionModel, LCMScheduler
|
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
import spaces
|
6 |
from PIL import Image
|
|
|
|
|
7 |
|
|
|
8 |
|
9 |
# Constants
|
10 |
base = "stabilityai/stable-diffusion-xl-base-1.0"
|
@@ -33,6 +36,8 @@ def generate_image(prompt, ckpt="4-Step"):
|
|
33 |
global loaded
|
34 |
print(prompt, ckpt)
|
35 |
|
|
|
|
|
36 |
checkpoint = checkpoints[ckpt][0]
|
37 |
num_inference_steps = checkpoints[ckpt][1]
|
38 |
|
|
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
import spaces
|
6 |
from PIL import Image
|
7 |
+
import requests
|
8 |
+
from googletrans import Translator
|
9 |
|
10 |
+
translator = Translator()
|
11 |
|
12 |
# Constants
|
13 |
base = "stabilityai/stable-diffusion-xl-base-1.0"
|
|
|
36 |
global loaded
|
37 |
print(prompt, ckpt)
|
38 |
|
39 |
+
print(translator.translate(prompt, dest='en'))
|
40 |
+
|
41 |
checkpoint = checkpoints[ckpt][0]
|
42 |
num_inference_steps = checkpoints[ckpt][1]
|
43 |
|