{"id":51116447,"url":"https://github.com/oracle-devrel/oci-generative-ai","last_synced_at":"2026-06-24T22:30:31.893Z","repository":{"id":103065343,"uuid":"569451068","full_name":"oracle-devrel/oci-generative-ai","owner":"oracle-devrel","description":"oci-generative-ai","archived":false,"fork":false,"pushed_at":"2025-01-21T20:35:57.000Z","size":2383,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-04-21T20:54:31.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"upl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oracle-devrel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-22T21:23:22.000Z","updated_at":"2025-09-09T08:34:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"9792925f-f770-412b-9453-7b9154640471","html_url":"https://github.com/oracle-devrel/oci-generative-ai","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"oracle-devrel/repo-template","purl":"pkg:github/oracle-devrel/oci-generative-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-generative-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-generative-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-generative-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-generative-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle-devrel","download_url":"https://codeload.github.com/oracle-devrel/oci-generative-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle-devrel%2Foci-generative-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34752465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"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":[],"created_at":"2026-06-24T22:30:28.919Z","updated_at":"2026-06-24T22:30:31.876Z","avatar_url":"https://github.com/oracle-devrel.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oci-generative-ai\n\n[![License: UPL](https://img.shields.io/badge/license-UPL-green)](https://img.shields.io/badge/license-UPL-green) [![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=oracle-devrel_oci-generative-ai)](https://sonarcloud.io/dashboard?id=oracle-devrel_oci-generative-ai)\n\n## Introduction\nTerraform script to start a **stable-diffusion, bloom and dreambooth** in compute instance using a nvidia GPU in OCI.\n\n**Stable Diffusion** is a state of the art text-to-image model that generates images from text.\n\n**Bloom** is a open-science, open-access multilingual large language model (LLM), with 176 billion parameters, and was trained using the NVIDIA AI platform, with text generation in 46 languages\n\n**Dreambooth** allow to fine-tune a stable diffusion model with your own data.\n\n## Prerequisites\n- Terraform\n- ssh-keygen\n- Huggingface account\n\n## Configuration\n\n1. Follow the instructions to add the authentication to your tenant https://medium.com/@carlgira/install-oci-cli-and-configure-a-default-profile-802cc61abd4f.\n\n2. Clone this repository\n\n3. Set three variables in your path. \n- The tenancy OCID, \n- The comparment OCID where the instance will be created.\n- The \"Region Identifier\" of region of your tenancy. https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm\n\n```\nexport TF_VAR_tenancy_ocid='\u003ctenancy-ocid\u003e'\nexport TF_VAR_compartment_ocid='\u003ccomparment-ocid\u003e'\nexport TF_VAR_region='\u003chome-region\u003e'\n```\n\n4. Execute the script generate-keys.sh to generate private key to access the instance\n```\nsh generate-keys.sh\n```\n\n## Build\nTo build simply execute the next commands. \n```\nterraform init\nterraform plan\nterraform apply\n```\n\n**After applying, the service will be ready in about 25 minutes** (it will install OS dependencies, nvidia drivers, and install stable-diffusion-web-ui, bloom-web-ui and dreambooth-webui.\n\n## Post configuration\nTo test the app it's necessary to create a ssh tunel to the port 7860 (stable-diffusion-webui), 5000 (bloom) and 3000 (dreambooth).  (the output of the terraform script will give the ssh full command so you only need to copy and paste)\n\n```\nssh -i server.key -L 7860:localhost:7860 -L 5000:localhost:5000 -L 3000:localhost:3000 ubuntu@\u003cinstance-public-ip\u003e\n```\n\nThe last step of the setup is to download the stable-diffusion model, for that, is necessary to have a huggingface account, create a token and accept to the conditions to use stable-diffusion.\n\n1. Go to https://huggingface.co and create an account.\n2. Go to https://huggingface.co/runwayml/stable-diffusion-v1-5 and accept the terms and conditions.\n3. Create an \"Access token\".\n    - Open your **Profile**\n    - Go to **Settings**\n    - Open **Access Token** and create a token with the role **\"write\"**\n\n\u003cimg src=\"images/huggingface-token.png\" /\u003e\n\nOnce the account is created, go to http://localhost:3000 (with the ssh tunnel opened) and put the credentials to download the stable diffusion model.\n\n\u003cimg src=\"images/setup-sd-model.png\" /\u003e\n\nThis is going to take 5 minutes, after that time, you are ready to go to test everything.\n\n## Test\nMake sure to have the ssh tunnel open to test the three apps.\n\n### Bloom\nOpen the URL http://localhost:5000, in the text box, write wharever question come to mind, ask for a story or create a dialog.\n\n\u003cimg src=\"images/bloom-webui.jpg\" /\u003e\n\n### Stable diffusion\nOpen the URL http://localhost:7860, in the top text area write and idea, and stable diffusion will try to draw it on screen. \n\n\u003cimg src=\"images/stable-diffusion-webui.jpg\" /\u003e\n\nUse https://lexica.art/ for examples of promts that you can use.\n\nPrompts examples:\n\n\n\u003e epic battle scene humans versus zombies, post apocalyptic, humanities last stand post human, Epic Background, highly detailed, sharp focus, 8k, 35mm, cinematic lighting\n\n\n\u003e a cowboy riding a tardigrade , made by Stanley Artgerm Lau, WLOP, Rossdraws, ArtStation, CGSociety, concept art, cgsociety, octane render, trending on artstation, artstationHD, artstationHQ, unreal engine, 4k, 8k,\n\n\n### Dreambooth\nOpen http://localhost:3000, it has several inputs, but most of them you can leave the default value and the page helps you on how to fill everything. \n\nMost of the time you only need two inputs: the **instance name** as a unique label to identify the thing or person you want to to train the model, and a **zip file** with the set of images you are going to use. (copy the that label somewhere because you are going to needed for later)\n\nMake sure that your images comply with this conditions:\n- All images must be 512 x 512\n- Make sure you are alone in the pictures\n- Have different clothing\n- Different facial expressions\n- Different backgrounds\n- Different angles\n- Only zip the images, *do not use folders*.\n- 3–5 images of full body\n- 5–7 images of half body\n- 10–15 close images of your face\n\n\u003cimg src=\"images/dreambooth-webui.png\" /\u003e\n\nIf everything is ok, you will see a countdown of the time it will take the training. That page will redirect you directly to the stable-diffusion-webui and you can start testing.\n\nSome prompts that you can use using the unique label you pass during training could be:\n\n\u003e photo of \u0026lt;your-label\u0026gt; as a funko\n\n\n\u003e photo of \u0026lt;your-label\u0026gt; as a character of game of thrones\n\n\n\u003e portrait of \u0026lt;your-label\u0026gt; with fully armored norse valkyrie, brass plated, symmetric golden wings, divine vibes,  sky background, sharp focus, highly detailed, cinematic lighting, studio quality, smooth render, unreal engine 5 rendered, octane, rendered, by artgerm, greg rutkowski, alphonse mucha\n\n## Clean\nTo delete the instance execute.\n```\nterraform destroy\n```\n\n## Notes/Issues\n1. If one is the three apps (stable-diffusion-webui, bloom-webui, dreambooth-webui) is down, you can check the logs and the state of each service, with the commands.\n\n```\nsystemctl status stabble-diffusion\nsystemctl status dreambooth\nsystemctl status bloom-webui\n```\n\nYou can try to start the service by.\n```\nsudo systemctl start \u003cservice-name\u003e\n```\n\n2. Once the training has started in dreambooth, you can check that is really working by running.\n```\nps -ef | grep acc\n```\nIt should appear 3 processes using the \"accelerate\" binary.\n\n3. Error ***Error: 404-NotAuthorizedOrNotFound, shape VM.GPU2.1 not found***.\nThis could be happening because in your availability domain (AD) there is no a VM.GPU2.1 shape available. The script use by default the first AD, but maybe you have to change this manually.\n\nGet the list of AD of your tenancy\n```\noci iam availability-domain list\n```\n\nIn the main.tf file, change the index number from \"0\" to other of the ADs of your region. (in the case that your region has more than one AD)\n```\navailability_domain = data.oci_identity_availability_domains.ADs.availability_domains[0].name\n```\nThis error can also happen if in your region there is no VM.GPU2.1, in that case you have to change the region var before executing the scripts. \n```\nexport TF_VAR_region='\u003cother-region\u003e'\n```\n\n## URLs\n- The stable-diffusion-webui project https://github.com/AUTOMATIC1111/stable-diffusion-webui\n- The bloom-webui https://github.com/carlgira/bloom-webui \n- The dreambooth-webui https://github.com/carlgira/dreambooth-webui\n- DotCSV explanation https://www.youtube.com/watch?v=rgKBjRLvjLs\n\n## Contributing\nThis project is open source.  Please submit your contributions by forking this repository and submitting a pull request!  Oracle appreciates any contributions that are made by the open source community.\n\n## License\nCopyright (c) 2024 Oracle and/or its affiliates.\n\nLicensed under the Universal Permissive License (UPL), Version 1.0.\n\nSee [LICENSE](LICENSE.txt) for more details.\n\nORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.  FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-devrel%2Foci-generative-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle-devrel%2Foci-generative-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle-devrel%2Foci-generative-ai/lists"}