Spaces:
Running
Running
salomonsky
commited on
Commit
•
cf3ba40
1
Parent(s):
3e3da0d
Update app.py
Browse files
app.py
CHANGED
@@ -90,7 +90,7 @@ def display_gallery():
|
|
90 |
prompt = get_prompt_for_image(image_file.name)
|
91 |
st.write(prompt[:300])
|
92 |
|
93 |
-
if st.button(f"
|
94 |
st.session_state['generated_image_path'] = str(image_file)
|
95 |
st.success("Imagen seleccionada")
|
96 |
|
@@ -111,7 +111,7 @@ def run_async(func, *args):
|
|
111 |
|
112 |
async def improve_prompt(prompt):
|
113 |
try:
|
114 |
-
instruction = ("With this idea, describe in English a detailed txt2img prompt in 500 characters
|
115 |
formatted_prompt = f"{prompt}: {instruction}"
|
116 |
response = llm_client.text_generation(formatted_prompt, max_new_tokens=500)
|
117 |
return response['generated_text'][:500] if 'generated_text' in response else response.strip()
|
|
|
90 |
prompt = get_prompt_for_image(image_file.name)
|
91 |
st.write(prompt[:300])
|
92 |
|
93 |
+
if st.button(f"FaceSwap", key=f"select_{i}_{image_file.name}"):
|
94 |
st.session_state['generated_image_path'] = str(image_file)
|
95 |
st.success("Imagen seleccionada")
|
96 |
|
|
|
111 |
|
112 |
async def improve_prompt(prompt):
|
113 |
try:
|
114 |
+
instruction = ("With this idea, describe in English a detailed txt2img prompt in 500 characters maximun")
|
115 |
formatted_prompt = f"{prompt}: {instruction}"
|
116 |
response = llm_client.text_generation(formatted_prompt, max_new_tokens=500)
|
117 |
return response['generated_text'][:500] if 'generated_text' in response else response.strip()
|