evalstate HF Staff commited on
Commit
2d6b790
·
verified ·
1 Parent(s): d952837

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -171,7 +171,7 @@ def build_camera_prompt(
171
 
172
  @spaces.GPU
173
  def infer_camera_edit(
174
- image: Optional[Image.Image] = None,
175
  rotate_deg: float = 0.0,
176
  move_forward: float = 0.0,
177
  vertical_tilt: float = 0.0,
@@ -182,7 +182,6 @@ def infer_camera_edit(
182
  num_inference_steps: int = 4,
183
  height: Optional[int] = None,
184
  width: Optional[int] = None,
185
- prev_output: Optional[Image.Image] = None,
186
  ) -> Tuple[Image.Image, int, str]:
187
  """
188
  Edit the camera angles/view of an image with Qwen Image Edit 2509 and dx8152's Qwen-Edit-2509-Multiple-angles LoRA.
@@ -191,10 +190,8 @@ def infer_camera_edit(
191
  to an input image.
192
 
193
  Args:
194
- image (PIL.Image.Image | None, optional):
195
- Input image to edit. If `None`, the function will instead try to
196
- use `prev_output`. At least one of `image` or `prev_output` must
197
- be available. Defaults to None.
198
  rotate_deg (float, optional):
199
  Horizontal rotation in degrees (-90, -45, 0, 45, 90). Positive values rotate
200
  to the left, negative to the right. Defaults to 0.0.
@@ -223,9 +220,6 @@ def infer_camera_edit(
223
  width (int, optional):
224
  Output image width. Must typically be a multiple of 8.
225
  If set to 0, the model will infer a size. Defaults to 1024 if none is provided.
226
- prev_output (PIL.Image.Image | None, optional):
227
- Previous output image to use as input when no new image is uploaded.
228
- Defaults to None.
229
 
230
  Returns:
231
  Tuple[PIL.Image.Image, int, str]:
@@ -249,8 +243,8 @@ def infer_camera_edit(
249
  pil_images.append(image.convert("RGB"))
250
  elif hasattr(image, "name"):
251
  pil_images.append(Image.open(image.name).convert("RGB"))
252
- elif prev_output:
253
- pil_images.append(prev_output.convert("RGB"))
254
 
255
  if len(pil_images) == 0:
256
  raise gr.Error("Please upload an image first.")
 
171
 
172
  @spaces.GPU
173
  def infer_camera_edit(
174
+ image,
175
  rotate_deg: float = 0.0,
176
  move_forward: float = 0.0,
177
  vertical_tilt: float = 0.0,
 
182
  num_inference_steps: int = 4,
183
  height: Optional[int] = None,
184
  width: Optional[int] = None,
 
185
  ) -> Tuple[Image.Image, int, str]:
186
  """
187
  Edit the camera angles/view of an image with Qwen Image Edit 2509 and dx8152's Qwen-Edit-2509-Multiple-angles LoRA.
 
190
  to an input image.
191
 
192
  Args:
193
+ image (PIL.Image.Image):
194
+ Input image to edit.
 
 
195
  rotate_deg (float, optional):
196
  Horizontal rotation in degrees (-90, -45, 0, 45, 90). Positive values rotate
197
  to the left, negative to the right. Defaults to 0.0.
 
220
  width (int, optional):
221
  Output image width. Must typically be a multiple of 8.
222
  If set to 0, the model will infer a size. Defaults to 1024 if none is provided.
 
 
 
223
 
224
  Returns:
225
  Tuple[PIL.Image.Image, int, str]:
 
243
  pil_images.append(image.convert("RGB"))
244
  elif hasattr(image, "name"):
245
  pil_images.append(Image.open(image.name).convert("RGB"))
246
+ # elif prev_output:
247
+ # pil_images.append(prev_output.convert("RGB"))
248
 
249
  if len(pil_images) == 0:
250
  raise gr.Error("Please upload an image first.")