Spaces:
Sleeping
Sleeping
lichorosario
commited on
Commit
•
084e4a2
1
Parent(s):
178d374
feat: Refactorizar función de refinamiento de imágenes en app.py
Browse files
app.py
CHANGED
@@ -98,7 +98,7 @@ def infer(selected_index, prompt, style_prompt, inf_steps, guidance_scale, width
|
|
98 |
used_prompt = prompt # El prompt usado es simplemente el prompt procesado
|
99 |
generated_image_path = load_img(generated_image_path, output_type="str")
|
100 |
|
101 |
-
return
|
102 |
|
103 |
except Exception as e:
|
104 |
gr.Warning("Error: " + str(e))
|
@@ -177,7 +177,7 @@ def refine_image(apply_refiner, image, model ,prompt, negative_prompt, num_infer
|
|
177 |
|
178 |
client = InferenceClient()
|
179 |
refined_image = client.image_to_image(
|
180 |
-
image
|
181 |
prompt=prompt,
|
182 |
negative_prompt=negative_prompt,
|
183 |
num_inference_steps=num_inference_steps,
|
@@ -186,7 +186,7 @@ def refine_image(apply_refiner, image, model ,prompt, negative_prompt, num_infer
|
|
186 |
model=model,
|
187 |
strength=strength
|
188 |
)
|
189 |
-
return [image
|
190 |
|
191 |
|
192 |
css="""
|
@@ -339,7 +339,7 @@ with gr.Blocks(css=css) as demo:
|
|
339 |
|
340 |
with gr.Row():
|
341 |
with gr.Column():
|
342 |
-
generated_image =
|
343 |
enhace_button = gr.Button("Enhance Image")
|
344 |
|
345 |
with gr.Column():
|
|
|
98 |
used_prompt = prompt # El prompt usado es simplemente el prompt procesado
|
99 |
generated_image_path = load_img(generated_image_path, output_type="str")
|
100 |
|
101 |
+
return generated_image_path, used_seed, used_prompt
|
102 |
|
103 |
except Exception as e:
|
104 |
gr.Warning("Error: " + str(e))
|
|
|
177 |
|
178 |
client = InferenceClient()
|
179 |
refined_image = client.image_to_image(
|
180 |
+
image,
|
181 |
prompt=prompt,
|
182 |
negative_prompt=negative_prompt,
|
183 |
num_inference_steps=num_inference_steps,
|
|
|
186 |
model=model,
|
187 |
strength=strength
|
188 |
)
|
189 |
+
return [image, refined_image]
|
190 |
|
191 |
|
192 |
css="""
|
|
|
339 |
|
340 |
with gr.Row():
|
341 |
with gr.Column():
|
342 |
+
generated_image = Image(label="Image / Refined Image")
|
343 |
enhace_button = gr.Button("Enhance Image")
|
344 |
|
345 |
with gr.Column():
|