{"id":25514423,"url":"https://github.com/kumes/stablediffusion4r","last_synced_at":"2026-05-01T17:35:44.777Z","repository":{"id":189518678,"uuid":"680742312","full_name":"kumeS/stableDiffusion4R","owner":"kumeS","description":"stableDiffusion4R: Provision of Stable Diffusion Interface for R","archived":false,"fork":false,"pushed_at":"2024-05-07T09:54:00.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-20T17:19:27.738Z","etag":null,"topics":["image","imagegeneration","img2img","r","stable-diffusion","txt2img"],"latest_commit_sha":null,"homepage":"https://kumes.github.io/stableDiffusion4R/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kumeS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-20T08:50:20.000Z","updated_at":"2024-05-07T09:54:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a198a9b-2cc4-4d83-acba-4c84375be3ee","html_url":"https://github.com/kumeS/stableDiffusion4R","commit_stats":null,"previous_names":["kumes/stablediffusion4r"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kumeS/stableDiffusion4R","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumeS%2FstableDiffusion4R","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumeS%2FstableDiffusion4R/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumeS%2FstableDiffusion4R/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumeS%2FstableDiffusion4R/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kumeS","download_url":"https://codeload.github.com/kumeS/stableDiffusion4R/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kumeS%2FstableDiffusion4R/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32507091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image","imagegeneration","img2img","r","stable-diffusion","txt2img"],"created_at":"2025-02-19T12:18:29.314Z","updated_at":"2026-05-01T17:35:44.753Z","avatar_url":"https://github.com/kumeS.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stableDiffusion4R\n\n[GitHub/stableDiffusion4R](https://github.com/kumeS/stableDiffusion4R)\n\n## Description\n\nArtificial Intelligence (AI)-based image generation techniques are revolutionizing various fields, and this package brings those capabilities into the R environment. \nThis package provides a seamless interface to integrate the 'Stable Diffusion' Web APIs (see \u003chttps://platform.stability.ai/docs/getting-started\u003e) into R, allowing users to leverage advanced image transformation methods. Specifically, this package includes functions for text-to-image (txt2img or t2i) and image-to-image (img2img or i2i) transformations using the 'Stable Diffusion' APIs, enabling creative and analytical applications in data visualization and more.\n\nThis package was separated from the [chatAI4R](https://github.com/kumeS/chatAI4R) project.\n\n## About this project \n\n- AI integration with R\n  - [Stable Diffusion API](https://platform.stability.ai/docs/api-reference#tag/v1generation) / DreamStudio (txt2img, img2img, up-scaling/Super-resolution)\n  - [DALL·E 2 / OpenAI API](https://platform.openai.com/docs/api-reference/images) (txt2img, img2img)\n\n## Installation of the stableDiffusion4R package\n\n### 1. Start R / RStudio console.\n\n### 2. Run the following commands in the R console:\n\n#### CRAN-version installation\n\n```r\n# CRAN-version installation (not yet)\ninstall.packages(\"BiocManager\", repos=\"http://cran.r-project.org\")\nBiocManager::install(\"EBImage\")\n\n#install.packages(\"stableDiffusion4R\")\n#library(stableDiffusion4R)\n```\n\n#### Dev-version installation (Recommended)\n\n```r\n# Dev-version installation\ninstall.packages(c(\"devtools\", \"BiocManager\"), repos=\"http://cran.r-project.org\")\nBiocManager::install(\"EBImage\")\n\ndevtools::install_github(\"kumeS/stableDiffusion4R\")\nlibrary(stableDiffusion4R)\n```\n\n### 3. Set the API Key According to each Web API\n\nFor example, to obtain a DreamStudio API key, please register as a member on the DreamStudio website (https://dreamstudio.ai/generate) and obtain your API key.\n\n```r\n# Set your key for the DreamStudio API\nSys.setenv(DreamStudio_API_KEY = \"Your API key\")\n```\n\nCreate an .Rprofile file in your home directory and add your API key (using the code above) into it.\n\n```{r}\n# Create a file\nfile.create(\"~/.Rprofile\") \n\n# [MacOS X] Open the file and edit it\nsystem(paste(\"open ~/.Rprofile\"))\n```\n\nNote: Please be aware of newline character inconsistencies across different operating systems.\n\n## Prompts for chatGPT / GPT-4\n\n|File|Description|Prompt|\n|:---|:---|:---:|\n||A prompt to analyze themes for unified imagery|[Prompt](https://github.com/kumeS/stableDiffusion4R/blob/main/inst/chatGPT_prompts/CraftingUnifiedImagery_v01.txt)|\n\n\n## R Functions\n  \n### Image generation functions using Stable Diffusion\n\n|Function|Description|Script|Flowchart|\n|:---|:---|:---:|:---:|\n|txt2img4R|Text-to-image generator using Stable Diffusion|[Script](https://github.com/kumeS/stableDiffusion4R/blob/main/R/txt2img4R.R)||\n|img2img4R|Image to Image Transformation using Stable Diffusion|[Script](https://github.com/kumeS/stableDiffusion4R/blob/main/R/img2img4R.R)||\n|img2img_upscale4R|Stable Diffusion Image to Image Up-scaling Transformation|[Script](https://github.com/kumeS/stableDiffusion4R/blob/main/R/img2img_upscale4R.R)||\n\n### Task specific image generation\n\n\n### Image generation functions using DALL·E 2  \n\n|Function|Description|Script|Flowchart|\n|:---|:---|:---:|:---:|\n|generateImage4R|Generate Images Using OpenAI API|[Script](https://github.com/kumeS/chatAI4R/blob/main/R/generateImage4R.R)||\n|editImage4R|Edit or Extend Images with OpenAI API|[Script](https://github.com/kumeS/chatAI4R/blob/main/R/editImage4R.R)||\n|imageVariation4R|Generate Image Variations using OpenAI API|[Script](https://github.com/kumeS/chatAI4R/blob/main/R/imageVariation4R.R)||\n|createImagePrompt_v1|create a prompt for generating an image from text using an AI model|[Script](https://github.com/kumeS/chatAI4R/blob/main/R/createImagePrompt_v1.R)||\n|createImagePrompt_v2|create a more complex prompt by considering additional attributes|[Script](https://github.com/kumeS/chatAI4R/blob/main/R/createImagePrompt_v2.R)||\n\n### Visualization functions\n\n|Function|Description|Script|Flowchart|\n|:---|:---|:---:|:---:|\n|Display|Display images and optionally write them into image files|[Script](https://github.com/kumeS/chatAI4R/blob/main/R/Display.R)||\n|createHEX|Create Hex Stickers for R Packages (experimental)|[Script](https://github.com/kumeS/chatAI4R/blob/main/R/createHEX.R)|[Flowchart](https://github.com/kumeS/chatAI4R/blob/main/inst/flowchart/createHEX.png)|\n\n\n\n\n### Visualization functions\n\n|Function|Description|Script|Flowchart|\n|:---|:---|:---:|:---:|\n|imgDisplay|Display images and optionally write them into image files|[Script](https://github.com/kumeS/stableDiffusion4R/blob/main/R/Display.R)||\n|imgDisplayAsMovie|Display Images as a Movie|[Script](https://github.com/kumeS/stableDiffusion4R/blob/main/R/DisplayAsMovie.R)||\n\n## License\n\nCopyright (c) 2023 Satoshi Kume. Released under the [Artistic License 2.0](http://www.perlfoundation.org/artistic_license_2_0).\n\n## Cite\n\nKume S. (2023) stableDiffusion4R: R Interface to 'Stable Diffusion' APIs for AI-Driven Creative Image Transformations\n\n```\n#BibTeX\n@misc{Kume2023stableDiffusion4R,\n  title={stableDiffusion4R: R Interface to 'Stable Diffusion' APIs for AI-Driven Creative Image Transformations},\n  author={Kume, Satoshi}, year={2023},\n  publisher={GitHub}, note={R Package},\n  howpublished={\\url{https://github.com/kumeS/stableDiffusion4R}},\n}\n```\n\n## Contributors\n\n- Satoshi Kume\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumes%2Fstablediffusion4r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkumes%2Fstablediffusion4r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkumes%2Fstablediffusion4r/lists"}