Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Golang implementation of yihong0618/BingImageCreator

License

NotificationsYou must be signed in to change notification settings

mrchi/bing-dalle3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bing-dalle3 is a Golang implementation ofyihong0618/BingImageCreator. It allows you to access theImage Creator from Microsoft Bing service through API calls.

In comparison toyihong0618/BingImageCreator,bing-dalle3 simplifies certain features, including:

  • The addition of a randomx-forwarded-for header to disguise the source IP of requests (useful if Bing does not correctly implement code to obtain the real IP).
  • The ability to save generated images to disk.
  • Implementation of a CLI command.

Quickstart

Please refer to the README ofyihong0618/BingImageCreator to obtain your Bing cookie.

package mainimport ("fmt""os"bingdalle3"github.com/mrchi/bing-dalle3")funcmain() {prompt:="月落乌啼霜满天,江枫渔火对愁眠。"bingClient:=bingdalle3.NewBingDalle3("Your Bing cookie")balance,err:=bingClient.GetTokenBalance()iferr!=nil {panic(err)}fmt.Println("balance: ",balance)writingId,err:=bingClient.CreateImage(prompt)iferr!=nil {panic(err)}fmt.Println("writingId: ",writingId)imageUrls,err:=bingClient.QueryResult(writingId,prompt)iferr!=nil {panic(err)}fmt.Println("imageUrls: ",imageUrls)imageContent,err:=bingClient.DownloadImage(imageUrls[0])iferr!=nil {panic(err)}iferr=os.WriteFile("output.jpeg",*imageContent,0644);err!=nil {panic(err)}}

Thanks

I'd like to express my gratitude to@yihong0618 and the original author@acheong08 for their contributions.

About

Golang implementation of yihong0618/BingImageCreator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp