Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -25,14 +25,15 @@ def get_sd_old(translated_txt):
|
|
25 |
#HF_TOKEN = os.environ.get("diffuse_new") or True
|
26 |
|
27 |
#headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
28 |
-
sd_inf = gr.Interface.load(name="spaces/stabilityai/stable-diffusion", api_key = HF_TOKEN
|
29 |
|
30 |
def get_sd(translated_txt):
|
31 |
print("******** Inside get_SD ********")
|
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 |
-
|
|
|
36 |
|
37 |
return sd_img_gallery[0]
|
38 |
|
|
|
25 |
#HF_TOKEN = os.environ.get("diffuse_new") or True
|
26 |
|
27 |
#headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
28 |
+
sd_inf = gr.Interface.load(name="spaces/stabilityai/stable-diffusion", api_key = HF_TOKEN, use_auth_token=HF_TOKEN )#'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')
|
29 |
|
30 |
def get_sd(translated_txt):
|
31 |
print("******** Inside get_SD ********")
|
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 |
+
examples = [[translated_txt, float(4),float(45), float(7.5),1024]]
|
36 |
+
sd_img_gallery = sd_inf(examples=examples, fn_index=2) # fn_index=2)[0] #(prompt, samples, steps, scale, seed) #translated_txt
|
37 |
|
38 |
return sd_img_gallery[0]
|
39 |
|