generate_social_image
nbdev_mkdocs.social_image_generator.generate_social_image(root_path: str, generator: str = 'file', prompt: str = 'Cute animal wearing hoodie sitting in high chair in purple room, browsing computer, 3d render', image_path: Optional[str] = None) -> None
async
¤
Generate a custom image for social card using the OpenAI Image API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
root_path |
str
|
The root path of the project. |
required |
generator |
str
|
Generator to use to create the social image. Valid options are: 'file' and 'dall_e'. |
'file'
|
prompt |
str
|
The prompt to use for generating the image. |
'Cute animal wearing hoodie sitting in high chair in purple room, browsing computer, 3d render'
|
image_path |
Optional[str]
|
Image file path to use in the social share image. Use images with a 1:1 aspect ratio and at least 512x512 pixels for the best results. If None, then the default image will be used. |
None
|
Note
The above docstring is autogenerated by docstring-gen library (https://github.com/airtai/docstring-gen)
Source code in nbdev_mkdocs/social_image_generator.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
|