Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,27 +22,20 @@ def infer(input_image, prompt, seed=42, randomize_seed=False, guidance_scale=2.5
|
|
| 22 |
for contextual image editing tasks.
|
| 23 |
|
| 24 |
Args:
|
| 25 |
-
input_image (PIL.Image.Image): The input image to be edited.
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
using the provided seed value. Defaults to False.
|
| 33 |
-
guidance_scale (float, optional): Controls how closely the model follows the
|
| 34 |
-
prompt. Higher values mean stronger adherence to the prompt but may reduce
|
| 35 |
-
image quality. Range: 1.0-10.0. Defaults to 2.5.
|
| 36 |
steps (int, optional): Controls how many steps to run the diffusion model for.
|
| 37 |
Range: 1-30. Defaults to 28.
|
| 38 |
progress (gr.Progress, optional): Gradio progress tracker for monitoring
|
| 39 |
generation progress. Defaults to gr.Progress(track_tqdm=True).
|
| 40 |
|
| 41 |
Returns:
|
| 42 |
-
|
| 43 |
-
- PIL.Image.Image: The generated/edited image
|
| 44 |
-
- int: The seed value used for generation (useful when randomize_seed=True)
|
| 45 |
-
- gr.update: Gradio update object to make the reuse button visible
|
| 46 |
|
| 47 |
Example:
|
| 48 |
>>> edited_image, used_seed, button_update = infer(
|
|
|
|
| 22 |
for contextual image editing tasks.
|
| 23 |
|
| 24 |
Args:
|
| 25 |
+
input_image (PIL.Image.Image): The path to the input image to be edited.
|
| 26 |
+
prompt (str): Text description of the desired edit to apply to the image. Examples: "Remove glasses", "Add a hat", "Change background to beach".
|
| 27 |
+
seed (int, optional): Random seed for reproducible generation.
|
| 28 |
+
Must be between 0 and MAX_SEED (2^31 - 1). Defaults to 42.
|
| 29 |
+
randomize_seed (bool, optional): If True, generates a random seed instead of using the provided seed value.
|
| 30 |
+
Defaults to False.
|
| 31 |
+
guidance_scale (float, optional): Controls how closely the model follows the prompt. Higher values mean stronger adherence to the prompt but may reduce image quality. Range: 1.0-10.0. Defaults to 2.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
steps (int, optional): Controls how many steps to run the diffusion model for.
|
| 33 |
Range: 1-30. Defaults to 28.
|
| 34 |
progress (gr.Progress, optional): Gradio progress tracker for monitoring
|
| 35 |
generation progress. Defaults to gr.Progress(track_tqdm=True).
|
| 36 |
|
| 37 |
Returns:
|
| 38 |
+
The modified image and seed used for generation.
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
Example:
|
| 41 |
>>> edited_image, used_seed, button_update = infer(
|