Skip to content

Commit

Permalink
✨ 增加AI绘画DallE-3支持
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Nov 24, 2023
1 parent 3f42909 commit a78dd54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions inc/ajax/ai.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function pk_ajax_ai_ask()
}
try {
$chat_res = $openaiClient->image([
'model'=> pk_get_option('ai_draw_dall_e_model', 'dall-e-2'),
'prompt' => $text,
'n' => 1,
'size' => pk_get_option('ai_draw_dall_e_size', '512x512'),
Expand Down
14 changes: 13 additions & 1 deletion inc/setting/options/OptionAi.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ function get_fields(): array
'sdt' => pk_is_checked('openai_dall_e'),
'tips' => __('启用后前端界面<code>勾选绘画模式</code>即可绘画', PUOCK),
],
[
'id' => 'ai_draw_dall_e_model',
'label' => __('AI绘画模型', PUOCK),
'type' => 'select',
'sdt' => pk_get_option('ai_draw_dall_e_model', 'dall-e-2'),
'options' => [
['label' => 'DallE-2', 'value' => 'dall-e-2'],
['label' => 'DallE-3', 'value' => 'dall-e-3'],
],
],
[
'id' => 'ai_draw_dall_e_size',
'label' => __('AI绘画图片大小', PUOCK),
Expand All @@ -85,7 +95,9 @@ function get_fields(): array
'options' => [
['label' => '256x256', 'value' => '256x256'],
['label' => '512x512', 'value' => '512x512'],
['label' => '1024x1024', 'value' => '1024x1024']
['label' => '1024x1024', 'value' => '1024x1024'],
['label' => '1792x1024(仅DallE-3支持)', 'value' => '1792x1024'],
['label' => '1024x1792(仅DallE-3支持)', 'value' => '1024x1792'],
],
],
[
Expand Down

0 comments on commit a78dd54

Please sign in to comment.