KingNish commited on
Commit
157d87f
Β·
verified Β·
1 Parent(s): ed79a6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -73,8 +73,7 @@ def king(type ,
73
  if type=="Image Editing" :
74
  raw_image = Image.open(input_image).convert('RGB')
75
  inputs = processor(raw_image, return_tensors="pt").to("cuda", torch.float16)
76
- pixel_values = inputs.pixel_values
77
- out = model.generate(pixel_values=pixel_values, max_length=20, num_beams=3, repetition_penalty=2.5)
78
  caption = processor.decode(out[0], skip_special_tokens=True)
79
  instructions = f"{instruction} {caption} {instruction}"
80
  print(instructions)
@@ -92,7 +91,7 @@ def king(type ,
92
  ).images
93
 
94
  refine = refiner(
95
- prompt=instruction2,
96
  guidance_scale=guidance_scale,
97
  num_inference_steps=steps,
98
  image=output_image,
 
73
  if type=="Image Editing" :
74
  raw_image = Image.open(input_image).convert('RGB')
75
  inputs = processor(raw_image, return_tensors="pt").to("cuda", torch.float16)
76
+ out = model.generate(**inputs, min_length=10, max_length=20)
 
77
  caption = processor.decode(out[0], skip_special_tokens=True)
78
  instructions = f"{instruction} {caption} {instruction}"
79
  print(instructions)
 
91
  ).images
92
 
93
  refine = refiner(
94
+ prompt=instructions,
95
  guidance_scale=guidance_scale,
96
  num_inference_steps=steps,
97
  image=output_image,