Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ import random
|
|
| 12 |
|
| 13 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 14 |
|
| 15 |
-
MODELS = ["stabilityai/stable-diffusion-2-1
|
| 16 |
|
| 17 |
#word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt")
|
| 18 |
#word_list = word_list_dataset["train"]['text']
|
|
@@ -33,7 +33,7 @@ def infer(prompt, negative, scale, model_id=MODELS[0], hf_token="", images=[]):
|
|
| 33 |
if not hf_token: hf_token = os.getenv("HF_TOKEN", None)
|
| 34 |
client = InferenceClient(model=model_id, token=hf_token)
|
| 35 |
for i in range(4):
|
| 36 |
-
image = client.text_to_image(prompt=prompt, negative_prompt=negative, guidance_scale=scale, seed=gen_random_seed())
|
| 37 |
if image: images.append(image)
|
| 38 |
yield images
|
| 39 |
#payload = {'prompt': prompt, 'negative_prompt': negative, 'guidance_scale': scale}
|
|
|
|
| 12 |
|
| 13 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 14 |
|
| 15 |
+
MODELS = ["stabilityai/stable-diffusion-2-1", "stabilityai/stable-diffusion-2-1-base", "stabilityai/stable-diffusion-2"]
|
| 16 |
|
| 17 |
#word_list_dataset = load_dataset("stabilityai/word-list", data_files="list.txt")
|
| 18 |
#word_list = word_list_dataset["train"]['text']
|
|
|
|
| 33 |
if not hf_token: hf_token = os.getenv("HF_TOKEN", None)
|
| 34 |
client = InferenceClient(model=model_id, token=hf_token)
|
| 35 |
for i in range(4):
|
| 36 |
+
image = client.text_to_image(prompt=prompt, negative_prompt=negative, guidance_scale=scale, num_inference_steps=45, seed=gen_random_seed())
|
| 37 |
if image: images.append(image)
|
| 38 |
yield images
|
| 39 |
#payload = {'prompt': prompt, 'negative_prompt': negative, 'guidance_scale': scale}
|