Severian commited on
Commit
5ae6892
·
verified ·
1 Parent(s): 375600a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -262,26 +262,26 @@ def inference(
262
  if invert_init_image and init_image is not None:
263
  init_image = invert_image(init_image)
264
 
265
- # Split the prompt into chunks to avoid truncation
266
- prompt_chunks = split_prompt(prompt)
267
- negative_prompt_chunks = split_prompt(negative_prompt)
268
 
269
  final_image = None
270
- for prompt_chunk, negative_prompt_chunk in zip(prompt_chunks, negative_prompt_chunks):
271
- out = pipe(
272
- prompt=prompt_chunk,
273
- negative_prompt=negative_prompt_chunk,
274
- image=init_image,
275
- control_image=control_image,
276
- width=1024,
277
- height=1024,
278
- guidance_scale=float(guidance_scale),
279
- controlnet_conditioning_scale=float(controlnet_conditioning_scale),
280
- generator=generator,
281
- strength=float(strength),
282
- num_inference_steps=30,
283
- )
284
- final_image = out.images[0] if final_image is None else final_image
285
 
286
  if invert_final_image:
287
  final_image = invert_image(final_image)
 
262
  if invert_init_image and init_image is not None:
263
  init_image = invert_image(init_image)
264
 
265
+ # Commenting out the prompt splitting
266
+ # prompt_chunks = split_prompt(prompt)
267
+ # negative_prompt_chunks = split_prompt(negative_prompt)
268
 
269
  final_image = None
270
+ # for prompt_chunk, negative_prompt_chunk in zip(prompt_chunks, negative_prompt_chunks):
271
+ out = pipe(
272
+ prompt=prompt, # Use the full prompt
273
+ negative_prompt=negative_prompt, # Use the full negative prompt
274
+ image=init_image,
275
+ control_image=control_image,
276
+ width=1024,
277
+ height=1024,
278
+ guidance_scale=float(guidance_scale),
279
+ controlnet_conditioning_scale=float(controlnet_conditioning_scale),
280
+ generator=generator,
281
+ strength=float(strength),
282
+ num_inference_steps=20,
283
+ )
284
+ final_image = out.images[0] if final_image is None else final_image
285
 
286
  if invert_final_image:
287
  final_image = invert_image(final_image)