Tensor Diffusion

community

AI & ML interests

StableDIffusion, Computer Vision, NLP

Recent Activity

tensor-diffusion's activity

eienmojikiΒ 
posted an update 13 days ago
view post
Post
1389
πŸ‘€ Introducing 2048 Game API: A RESTful API for the Classic Puzzle Game 🧩

I'm excited to share my latest project, 2048 Game API, a RESTful API that allows you to create, manage, and play games of 2048, a popular puzzle game where players slide numbered tiles to combine them and reach the goal of getting a tile with the value of 2048.

⭐ Features
Create new games with customizable board sizes (3-8)
Make moves (up, down, left, right) and get the updated game state
Get the current game state, including the board, score, and game over status
Delete games
Generate images of the game board with customizable themes (light and dark)

πŸ”— API Endpoints
POST /api/games - Create a new game
GET /api/games/:gameId - Get the current game state
POST /api/games/:gameId/move - Make a move (up, down, left, right)
DELETE /api/games/:gameId - Delete a game
GET /api/games/:gameId/image - Generate an image of the game board

🧩 Example Use Cases
- Create a new game with a 4x4 board:
curl -X POST -H "Content-Type: application/json" -d '{"size": 4}' http://localhost:3000/api/games

- Make a move up:
curl -X POST -H "Content-Type: application/json" -d '{"direction": "up"}' http://localhost:3000/api/games/:gameId/move

- Get the current game state:
curl -X GET http://localhost:3000/api/games/:gameId

πŸ’• Try it out!
- Demo: eienmojiki/2048
- Source: https://github.com/kogakisaki/koga-2048
- You can try out the API by running the server locally or using a tool like Postman to send requests to the API. I hope you enjoy playing 2048 with this API!

Let me know if you have any questions or feedback!

🐧 Mouse1 is our friend🐧
not-lainΒ 
posted an update about 1 month ago
view post
Post
1822
ever wondered how you can make an API call to a visual-question-answering model without sending an image url πŸ‘€

you can do that by converting your local image to base64 and sending it to the API.

recently I made some changes to my library "loadimg" that allows you to make converting images to base64 a breeze.
πŸ”— https://github.com/not-lain/loadimg

API request example πŸ› οΈ:
from loadimg import load_img
from huggingface_hub import InferenceClient

# or load a local image
my_b64_img = load_img(imgPath_url_pillow_or_numpy ,output_type="base64" ) 

client = InferenceClient(api_key="hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")

messages = [
	{
		"role": "user",
		"content": [
			{
				"type": "text",
				"text": "Describe this image in one sentence."
			},
			{
				"type": "image_url",
				"image_url": {
					"url": my_b64_img # base64 allows using images without uploading them to the web
				}
			}
		]
	}
]

stream = client.chat.completions.create(
    model="meta-llama/Llama-3.2-11B-Vision-Instruct", 
	messages=messages, 
	max_tokens=500,
	stream=True
)

for chunk in stream:
    print(chunk.choices[0].delta.content, end="")
1aurentΒ 
posted an update 4 months ago
view post
Post
1132
Hey everyone πŸ€—!
We (finegrain) have created some custom ComfyUI nodes to use our refiners micro-framework inside comfy! πŸŽ‰

We only support our new Box Segmenter at the moment, but we're thinking of adding more nodes since there seems to be a demand for it. We leverage the new (beta) Comfy Registry to host our nodes. They are available at: https://registry.comfy.org/publishers/finegrain/nodes/comfyui-refiners. You can install them by running:
comfy node registry-install comfyui-refiners

Or by unzipping the archive you can download by clicking "Download Latest" into your custom_nodes comfy folder.
We are eager to hear your feedbacks and suggestions for new nodes and how you'll use them! πŸ™
1aurentΒ 
posted an update 4 months ago
view post
Post
4411
Hey everyone πŸ€—!
Check out this awesome new model for object segmentation!
finegrain/finegrain-object-cutter.

We (finegrain) have trained this new model in partnership with Nfinite and some of their synthetic data, the resulting model is incredibly accurate πŸš€.
It’s all open source under the MIT license ( finegrain/finegrain-box-segmenter), complete with a test set tailored for e-commerce ( finegrain/finegrain-product-masks-lite). Have fun experimenting with it!
DamarJatiΒ 
posted an update 4 months ago
view post
Post
3483
Improved ControlNet!
Now supports dynamic resolution for perfect landscape and portrait outputs. Generate stunning images without distortionβ€”optimized for any aspect ratio!
...
DamarJati/FLUX.1-DEV-Canny
not-lainΒ 
posted an update 5 months ago
1aurentΒ 
posted an update 5 months ago
view post
Post
2567
Hey everyone πŸ€—!
Check out this cool new space from Finegrain: finegrain/finegrain-object-eraser

Under the hoods, it's a pipeline of models (currently exposed via an API) that allows you to easily erase any object from your image just by naming it or selecting it! Not only will the object disappear, but so will its effects on the scene, like shadows and reflections. Built on top of Refiners, our micro-framework for simple foundation model adaptation (feel free to star it on GitHub if you like it: https://github.com/finegrain-ai/refiners)
  • 2 replies
Β·
1aurentΒ 
posted an update 5 months ago
not-lainΒ 
posted an update 5 months ago
view post
Post
7697
I am now a huggingface fellow πŸ₯³
Β·
1aurentΒ 
posted an update 6 months ago
not-lainΒ 
posted an update 6 months ago
view post
Post
2661
I have finished writing a blogpost about building an image-based retrieval system, This is one of the first-ever approaches to building such a pipeline using only open-source models/libraries πŸ€—

You can checkout the blogpost in https://huggingface.co/blog/not-lain/image-retriever and the associated space at not-lain/image-retriever .

✨ If you want to request another blog post consider letting me know down below or you can reach out to me through any of my social media

πŸ“– Happy reading !
not-lainΒ 
posted an update 6 months ago
view post
Post
1435
Hello beautiful people.
I wanted to thank everyone that read my blogpost and I am glad to share that we have achieved 11000 readers πŸ₯³
I couldn't have done this without you, so once again thanks a lot everyone for the support πŸ’–
If you haven't already you can read my blog post at: https://huggingface.co/blog/not-lain/rag-chatbot-using-llama3
not-lainΒ 
posted an update 7 months ago
view post
Post
2076
It is with great pleasure I inform you that huggingface's ModelHubMixin reached 200+ models on the hub πŸ₯³

ModelHubMixin is a class developed by HF to integrate AI models with the hub with ease and it comes with 3 methods :
* save_pretrained
* from_pretrained
* push_to_hub

Shoutout to @nielsr , @Wauplin and everyone else on HF for their awesome work πŸ€—

If you are not familiar with ModelHubMixin and you are looking for extra resources you might consider :
* docs: https://huggingface.co/docs/huggingface_hub/main/en/package_reference/mixins
πŸ”—blog about training models with the trainer API and using ModelHubMixin: https://huggingface.co/blog/not-lain/trainer-api-and-mixin-classes
πŸ”—GitHub repo with pip integration: https://github.com/not-lain/PyTorchModelHubMixin-template
πŸ”—basic guide: https://huggingface.co/posts/not-lain/884273241241808
not-lainΒ 
posted an update 7 months ago
view post
Post
1924
I will be delivering an introductory coding session this Sunday 7Pm gmt+1 time about huggingface, if you are new to HF and don't know where to begin, you are welcome to join us πŸ€—
πŸ“ŒPlace: huggingface discord server
πŸ”—Link : https://discord.gg/hugging-face-879548962464493619?event=1245406127668203541
  • 2 replies
Β·