Spaces:
Runtime error
Runtime error
updated the examples format
Browse files
app.py
CHANGED
|
@@ -10,23 +10,23 @@ class EnhancePrompt(Signature):
|
|
| 10 |
# Ensure the correct fields are defined
|
| 11 |
original_prompt:str = InputField(desc="Short prompt describing the filtered image")
|
| 12 |
task_goal: str = InputField(desc="What transformation you want, e.g., remove filters")
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
enhancer
|
| 26 |
-
|
| 27 |
-
task_goal="restore original face",
|
| 28 |
-
enhanced_prompt="natural face, original skin texture, no filter, raw facial features"
|
| 29 |
-
))
|
| 30 |
|
| 31 |
# π§ Load ControlNet
|
| 32 |
controlnet = ControlNetModel.from_pretrained(
|
|
|
|
| 10 |
# Ensure the correct fields are defined
|
| 11 |
original_prompt:str = InputField(desc="Short prompt describing the filtered image")
|
| 12 |
task_goal: str = InputField(desc="What transformation you want, e.g., remove filters")
|
| 13 |
+
__output__: str = OutputField(desc="More detailed, enhanced prompt suitable for image generation.")
|
| 14 |
|
| 15 |
+
examples = [
|
| 16 |
+
Example(
|
| 17 |
+
original_prompt = "girl face with some filter",
|
| 18 |
+
task_goal = "remove filters and restore natural face",
|
| 19 |
+
__output__="realistic photo of a girl without makeup, natural skin tone, no smoothing, clear eyes."
|
| 20 |
+
),
|
| 21 |
+
Example(
|
| 22 |
+
original_prompt = "face with beauty filter",
|
| 23 |
+
task_goal = "restore original face",
|
| 24 |
+
__output__="natural face, original skin texture, no filter, raw facial features"
|
| 25 |
+
)
|
| 26 |
+
]
|
| 27 |
|
| 28 |
+
# Instantiate the enhancer with the proper Signature model
|
| 29 |
+
enhancer = Predict(EnhancePrompt,examples=examples)
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# π§ Load ControlNet
|
| 32 |
controlnet = ControlNetModel.from_pretrained(
|