{"id":19267934,"url":"https://github.com/yav-ai/nodejs-stable-diffusion-xl-base-1.0-hugging-face-inference-api","last_synced_at":"2025-04-11T18:24:53.820Z","repository":{"id":203529937,"uuid":"694439216","full_name":"YAV-AI/NodeJS-Stable-Diffusion-XL-Base-1.0-Hugging-Face-Inference-API","owner":"YAV-AI","description":"A simple node.js example that generates an image using StableDiffusion via Hugging Face Inference API.","archived":false,"fork":false,"pushed_at":"2023-10-25T13:13:28.000Z","size":304,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T18:24:47.630Z","etag":null,"topics":["ai","generative-ai","huggingface","image-generation","inference-api","nodejs","nodejsexamples","sdxl","stable-diffusion","stable-diffusion-api","stable-diffusion-xl"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YAV-AI.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}},"created_at":"2023-09-21T02:11:51.000Z","updated_at":"2025-04-02T19:32:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb8b17a3-bcc9-4100-b1be-b3e36c664b6c","html_url":"https://github.com/YAV-AI/NodeJS-Stable-Diffusion-XL-Base-1.0-Hugging-Face-Inference-API","commit_stats":null,"previous_names":["yav-ai/nodejs-stable-diffusion-xl-base-1.0-hugging-face-inference-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-Stable-Diffusion-XL-Base-1.0-Hugging-Face-Inference-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-Stable-Diffusion-XL-Base-1.0-Hugging-Face-Inference-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-Stable-Diffusion-XL-Base-1.0-Hugging-Face-Inference-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAV-AI%2FNodeJS-Stable-Diffusion-XL-Base-1.0-Hugging-Face-Inference-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YAV-AI","download_url":"https://codeload.github.com/YAV-AI/NodeJS-Stable-Diffusion-XL-Base-1.0-Hugging-Face-Inference-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456381,"owners_count":21106607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ai","generative-ai","huggingface","image-generation","inference-api","nodejs","nodejsexamples","sdxl","stable-diffusion","stable-diffusion-api","stable-diffusion-xl"],"created_at":"2024-11-09T20:14:31.016Z","updated_at":"2025-04-11T18:24:53.793Z","avatar_url":"https://github.com/YAV-AI.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NodeJS example: Stable Diffusion using Hugging Face Inference API\n\n## Installation\n\nTo set up and run this example, follow these steps:\n\n1. Clone this repo.\n\n2. Navigate to the project directory.\n\n3. Open `index.mjs` Replace `\"Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"` in the code with your Hugging Face API token. You can obtain an API token by signing up on the [Hugging Face website](https://huggingface.co/).\n\n4. Install the required Node.js packages by running the following command:\n\n   ```bash\n   npm install\n   ```\n\n## How to use?\n\nOpen index.mjs and change your image caption\n\n```js\ngenerateImage(\"photo of rocket launching into space\");\n```\n\nOpen terminal and run\n\n```bash\nnode index.mjs\n```\n\nOnce the image is processed, it will return\n\n```\nImage saved to: output/photo-of-rocket-launching-into-space.png\n```\n\n## Examples\n\n\u003cimg src=\"output/photo-of-rocket-launching-into-space.png\" /\u003e\n\u003cimg src=\"output/astronaut-riding-a-horse.png\" /\u003e\n\u003cimg src=\"output/cyberpunk-city-nightscape.png\" /\u003e\n\n## Further reading\n\nhttps://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0 \u003cbr /\u003e\nhttps://huggingface.co/docs/api-inference/index \u003cbr /\u003e\nhttps://huggingface.co/docs/inference-endpoints/index\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyav-ai%2Fnodejs-stable-diffusion-xl-base-1.0-hugging-face-inference-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyav-ai%2Fnodejs-stable-diffusion-xl-base-1.0-hugging-face-inference-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyav-ai%2Fnodejs-stable-diffusion-xl-base-1.0-hugging-face-inference-api/lists"}