Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
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=
|
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,
|