chrisjayden commited on
Commit
de9ac7b
·
verified ·
1 Parent(s): 3aa45cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -10,19 +10,17 @@ pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torc
10
 
11
  # Define the inference function
12
  def ghibli_transform(input_image, prompt="ghibli style", strength=0.75, guidance_scale=7.5):
13
- # Debug: Check input type and value
14
  print(f"Input type: {type(input_image)}")
15
  if input_image is None:
16
  raise gr.Error("Please upload an image before clicking Transform!")
17
 
18
- # Since input is now PIL, just resize and ensure RGB
19
  try:
20
  init_image = input_image.resize((768, 768)).convert("RGB")
21
  print(f"Converted to PIL Image: {type(init_image)}")
22
  except Exception as e:
23
  raise gr.Error(f"Failed to process image: {str(e)}")
24
 
25
- # Generate the Ghibli-style image
26
  try:
27
  output = pipe(
28
  prompt=prompt,
 
10
 
11
  # Define the inference function
12
  def ghibli_transform(input_image, prompt="ghibli style", strength=0.75, guidance_scale=7.5):
13
+ print(f"Input received: {input_image is not None}")
14
  print(f"Input type: {type(input_image)}")
15
  if input_image is None:
16
  raise gr.Error("Please upload an image before clicking Transform!")
17
 
 
18
  try:
19
  init_image = input_image.resize((768, 768)).convert("RGB")
20
  print(f"Converted to PIL Image: {type(init_image)}")
21
  except Exception as e:
22
  raise gr.Error(f"Failed to process image: {str(e)}")
23
 
 
24
  try:
25
  output = pipe(
26
  prompt=prompt,