Spaces:
Running
on
Zero
Allow raw input of QR code text to enable VCARD, calendar etc.
I'm not following what and why you did it here... url field specifically for storing url, all description of what you want should went into prompt. Can you elaborate a bit on our changes/ why you think those should be merged?
Thanks for providing screenshot. URL field is used only for URL creation to encode into image, all other info would not be used by QR code generation models in any way. I checked what is VCARD but currently it's not supported in ComfyUI workflow which powers this demo. It could be a nice feature to add but it's not supported in the moment
After investigating I found that it might actually work, but you need to add a change for protocol flag -
comfy_qr_by_module_size_15 = comfy_qr_by_module_size.generate_qr(
protocol="Https", <- change it to "None" if VCARD text "Https" if "URL" text
text=qr_text,
in case when you providing VCARD text protocol should be set to "None" otherwise "https" would be added before VCARD text. Hope that's clear, what needs to be changed in PR to make it work, let me know otherwise!
Your examples with Wi-fi and Google Maps would work but VCARD fails due to exceeding max image size after applying suggestion from my previous comment. As a result standard QR is working correctly for VCARD, but a generated one became unreadable. It's an interesting use case I would check most likely tomorrow how to solve it
Thank you.
After investigating I found that it might actually work, but you need to add a change for protocol flag -
comfy_qr_by_module_size_15 = comfy_qr_by_module_size.generate_qr(
protocol="Https", <- change it to "None" if VCARD text "Https" if "URL" text
text=qr_text,
in case when you providing VCARD text protocol should be set to "None" otherwise "https" would be added before VCARD text. Hope that's clear, what needs to be changed in PR to make it work, let me know otherwise!
Would you be able to do this change? And I would investigate that issue with max image size for VCARD?
I couldn't update this pull request but I made another with both sets of changes here:
https://huggingface.co/spaces/Oysiyl/AI-QR-code-generator/discussions/6
@huggerhuggy Yeah, quite strange - I can't even see that branch with pull request locally for some reason... Closing that discussion then
@huggerhuggy For VCARD I made a substantial progress relating to changing max_image size which is a bottleneck for now. Have promising local results, expecting to push those in upcoming days
Thank you. I think it will be cool for people making contact cards e.g. business cards.
Done! Feel free to check now - just increase image_size whenever you have a lot of info in contact card @huggerhuggy otherwise you would see an error that not sufficient image size. Also it increases processing and qR is more granular and less feel like less "generated". feel free to check!
Thank you @Oysiyl
I set image_size to the max 1024 but I get an Error doing a test VCARD:
BEGIN:VCARD
VERSION:3.0
N:Doe;John;;;
FN:John Doe
ORG:Example Company
TITLE:Senior Developer
TEL;TYPE=WORK,VOICE:+1-555-123-4567
TEL;TYPE=CELL:+1-555-987-6543
EMAIL:[email protected]
URL:https://www.example.com
ADR;TYPE=WORK:;;123 Main Street;New York;NY;10001;USA
END:VCARD
I checked your example - it requires 1116 pixels to encode info into QRCode which is more than allowed 1024. It's pity, that at the moment I can't show to user error with explanation why it fails because of HF Space - otherwise you would have be able to see it on your own. For now you can set border size 4 -> 2, error correctness Medium -> Low, module size 12 -> 10. And with 1024 it would sufficient to receive result without error:
Thank you. What is the limit of 1024 caused by?
Just resource constraints - it increases time and granularity so the bigger you go the less "AI" QR code would look like (check my previous message with example). Apart from that it could be increased I think further from 1024
I think it would be nice to have the option so it is at least possible to do a full-size VCARD or other code, in my opinion.
do you have example of full size VCARD? It's possible with current constraints due to QR technology to create VCARD with few rows instead of 8 or 10. Example of full size VCARD would help me to tune pipeline a bit to make as upper bound full-size VCARD text length(QR code sensitive to how much info you want to have inside)
Just the same example as before, it's hard to get it to generate. Perhaps it is too much to fit in a reasonable code anyway.
Yeah, there is limits how much info you can fit in QR image size let's say 512... I thought about using something like URL Shortener to hide that info under small link so that it would be less info for QR. What do you think, or some other ideas? @huggerhuggy
That's a good idea!


