Open kadirnar opened 7 months ago
Code:
outputv0 = pipe(
prompt,
image=image,
mask_image=mask,
num_inference_steps=35,
guidance_scale=5.0,
strength=1.0,
num_images_per_prompt=1,
cache_interval=5,
cache_layer_id=0,
cache_block_id=0,
uniform=True,
output_type='pil',
return_dict=True
).images
Hi @kadirnar, please tune the cache_interval, cache_layer_id & cache_block_id. Caching in a deeper layer can improve the quality yet reduce the speedup.
Hi @kadirnar, please tune the cache_interval, cache_layer_id & cache_block_id. Caching in a deeper layer can improve the quality yet reduce the speedup.
Can you suggest sample values? I don't know what values I should give.
Maybe we can use a smaller cache_interval like 3 or 4, and choose a deeper layer for caching by increasing the cache_block_id & cache_layer_id. cache_layer_id=0 & cache_block_id=0
uses the very first skip connection for caching.
I changed the UNet2DConditionModel, ImageProjection and DiffusionPipeline functions in the pipeline_stable_diffusion_inpaint.py file. The code is fast but the output is terrible. What can I do to improve this?