Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -12,7 +12,7 @@ device = th.device('cpu' if not th.cuda.is_available() else 'cuda')
|
|
12 |
print(f"device is :{device}")
|
13 |
|
14 |
# init stable diffusion model
|
15 |
-
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=th.float32, use_auth_token= HF_TOKEN).to(device) #revision="fp16",
|
16 |
|
17 |
def get_sd_old(translated_txt):
|
18 |
scale=7.5
|
@@ -32,7 +32,7 @@ def get_sd(translated_txt):
|
|
32 |
print(f"translated_txt is : {translated_txt}")
|
33 |
#sd_inf = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion", use_auth_token='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')
|
34 |
print(f"stable Diff inf is : {sd_inf}")
|
35 |
-
sd_img_gallery = sd_inf(translated_txt, float(4),float(45), 7.5,float(1024), fn_index=
|
36 |
|
37 |
return sd_img_gallery[0]
|
38 |
|
|
|
12 |
print(f"device is :{device}")
|
13 |
|
14 |
# init stable diffusion model
|
15 |
+
#pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=th.float32, use_auth_token= HF_TOKEN).to(device) #revision="fp16",
|
16 |
|
17 |
def get_sd_old(translated_txt):
|
18 |
scale=7.5
|
|
|
32 |
print(f"translated_txt is : {translated_txt}")
|
33 |
#sd_inf = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion", use_auth_token='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')
|
34 |
print(f"stable Diff inf is : {sd_inf}")
|
35 |
+
sd_img_gallery = sd_inf(translated_txt, float(4),float(45), float(7.5),float(1024), fn_index=1)[0] #(prompt, samples, steps, scale, seed) #translated_txt
|
36 |
|
37 |
return sd_img_gallery[0]
|
38 |
|